opensearch-project / k-NN

🆕 Find the k-nearest neighbors (k-NN) for your vector data
https://opensearch.org/docs/latest/search-plugins/knn/index/
Apache License 2.0
156 stars 123 forks source link

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

Open navneet1v opened 4 days ago

navneet1v commented 4 days ago

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

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 commented 2 days ago

Please fix the CI

seems to be related to new dependency upgrades. Will check

navneet1v commented 8 hours ago

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