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

Added null checks for fieldInfo in ExactSearcher to avoid NPE while running exact search for segments with no vector field #2278

Merged
merged 1 commit into from
Nov 22, 2024

Conversation

navneet1v
Copy link
Collaborator

@navneet1v navneet1v commented Nov 17, 2024

Description

Added null checks for fieldInfo in ExactSearcher to avoid NPE while running exact search for segments with no vector field

Ensured that in ExactSearcher class, if fieldInfo is null for a field no results are returned. This is similar to what we have to ANNSearch ref: https://github.com/opensearch-project/k-NN/blob/main/src/main/java/org/opensearch/knn/index/query/KNNWeight.java#L232-L236.

Related Issues

Resolves #2277

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.

@navneet1v navneet1v force-pushed the main branch 2 times, most recently from 2b6a3b1 to 6b758f6 Compare November 19, 2024 05:01
shatejas
shatejas previously approved these changes Nov 19, 2024
Copy link
Collaborator

@shatejas shatejas left a comment

Choose a reason for hiding this comment

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

Please fix the CI

@navneet1v
Copy link
Collaborator Author

Please fix the CI

seems to be related to new dependency upgrades. Will check

shatejas
shatejas previously approved these changes Nov 19, 2024
@navneet1v navneet1v changed the title Fix NPE in ANN search when a segment doesn't contain vector field Added null checks for fieldInfo in ExactSearcher to avoid NPE while running exact search for segments with no vector field Nov 20, 2024
@navneet1v navneet1v force-pushed the main branch 2 times, most recently from ddc5ffd to 33f05a5 Compare November 20, 2024 05:10
@navneet1v navneet1v requested a review from shatejas November 20, 2024 05:11
shatejas
shatejas previously approved these changes Nov 20, 2024
Copy link
Collaborator

@shatejas shatejas left a comment

Choose a reason for hiding this comment

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

LGTM, minor comment around testing

Copy link
Contributor

@Vikasht34 Vikasht34 left a comment

Choose a reason for hiding this comment

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

Looks good to me :)

…unning exact search for segments with no vector field

Signed-off-by: Navneet Verma <[email protected]>
Copy link
Contributor

@Vikasht34 Vikasht34 left a comment

Choose a reason for hiding this comment

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

LGTM

@navneet1v
Copy link
Collaborator Author

@heemin32 , @jmazanec15 and @shatejas can you guys review this PR.

@navneet1v navneet1v merged commit 7523cc3 into opensearch-project:main Nov 22, 2024
33 checks passed
opensearch-trigger-bot bot pushed a commit that referenced this pull request Nov 22, 2024
…unning exact search for segments with no vector field (#2278)

Signed-off-by: Navneet Verma <[email protected]>
(cherry picked from commit 7523cc3)
navneet1v added a commit that referenced this pull request Nov 22, 2024
…unning exact search for segments with no vector field (#2278) (#2285)

Signed-off-by: Navneet Verma <[email protected]>
(cherry picked from commit 7523cc3)

Co-authored-by: Navneet Verma <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 2.x Bug Fixes Changes to a system or product designed to handle a programming bug/glitch
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

[BUG] NPE while calling ANN search when deleted docs or a segment with no vector field present in the index
4 participants