Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add check to directly use ANN Search when filters match all docs. #2320

Merged
merged 4 commits into from
Jan 3, 2025

Conversation

weiwang118
Copy link
Contributor

@weiwang118 weiwang118 commented Dec 11, 2024

Description

This change aims to resolve this github issue: #1387
by adding a simple check in searchLeaf method so that if the filters match all doc IDs in the segment (Max Doc == size of FilterBitSet), then we directly do ANN search and avoid other unnecessary steps. This will help improve the search performance.

Related Issues

Resolves #1387

Check List

  • New functionality includes testing.
  • New functionality has been documented.
  • API changes companion pull request created.
  • Commits are signed per the DCO using --signoff.
  • Public documentation issue/PR created.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

@weiwang118 weiwang118 force-pushed the mainline-wei branch 2 times, most recently from fdba64d to c599062 Compare January 2, 2025 15:55
Copy link
Member

@VijayanB VijayanB left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks @weiwang118 for making changes and addressing comments

@shatejas shatejas merged commit 6f5313f into opensearch-project:main Jan 3, 2025
34 checks passed
opensearch-trigger-bot bot pushed a commit that referenced this pull request Jan 3, 2025
)

* Add check to directly use ANN Search when filters match all docs.

Signed-off-by: Wei Wang <[email protected]>

* Fix failed tests and rebase on main branch

Signed-off-by: Wei Wang <[email protected]>

* pass filterbitset as null and add integ tests.

Signed-off-by: Wei Wang <[email protected]>

---------

Signed-off-by: Wei Wang <[email protected]>
Co-authored-by: Wei Wang <[email protected]>
(cherry picked from commit 6f5313f)
weiwang118 added a commit to weiwang118/k-NN that referenced this pull request Jan 6, 2025
…ensearch-project#2320)

* Add check to directly use ANN Search when filters match all docs.

Signed-off-by: Wei Wang <[email protected]>

* Fix failed tests and rebase on main branch

Signed-off-by: Wei Wang <[email protected]>

* pass filterbitset as null and add integ tests.

Signed-off-by: Wei Wang <[email protected]>

---------

Signed-off-by: Wei Wang <[email protected]>
Co-authored-by: Wei Wang <[email protected]>
(cherry picked from commit 6f5313f)
Signed-off-by: Wei Wang <[email protected]>
VijayanB pushed a commit that referenced this pull request Jan 6, 2025
) (#2367)

* Add check to directly use ANN Search when filters match all docs.



* Fix failed tests and rebase on main branch



* pass filterbitset as null and add integ tests.



---------



(cherry picked from commit 6f5313f)

Signed-off-by: Wei Wang <[email protected]>
Co-authored-by: Wei Wang <[email protected]>
Gankris96 pushed a commit to Gankris96/k-NN that referenced this pull request Jan 8, 2025
…ensearch-project#2320)

* Add check to directly use ANN Search when filters match all docs.

Signed-off-by: Wei Wang <[email protected]>

* Fix failed tests and rebase on main branch

Signed-off-by: Wei Wang <[email protected]>

* pass filterbitset as null and add integ tests.

Signed-off-by: Wei Wang <[email protected]>

---------

Signed-off-by: Wei Wang <[email protected]>
Co-authored-by: Wei Wang <[email protected]>
owenhalpert pushed a commit to owenhalpert/k-NN that referenced this pull request Jan 9, 2025
…ensearch-project#2320)

* Add check to directly use ANN Search when filters match all docs.

Signed-off-by: Wei Wang <[email protected]>

* Fix failed tests and rebase on main branch

Signed-off-by: Wei Wang <[email protected]>

* pass filterbitset as null and add integ tests.

Signed-off-by: Wei Wang <[email protected]>

---------

Signed-off-by: Wei Wang <[email protected]>
Co-authored-by: Wei Wang <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants