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

KNNIterators should support with and without filters #2155

Closed VijayanB closed 1 month ago

VijayanB commented 1 month ago

Description

Update VectorIterator, ByteIterator, NestedVectorIterator, NestedByteIterator to iterate even if there are no filters provided. Currently this is used by exact search to score either topK docs or all docs when filter is provided by users. However, in future we will be allowing exact search even if there are no filters. Hence, decouple filter and make it option to support both cases.

Related Issues

Pre-requisite for #1942

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.