Skip to content

[Backport 3.6] [Bug] Fix bug when dimension <= 56 in Faiss SQ.#3233

Closed
opensearch-trigger-bot[bot] wants to merge 6 commits into3.6from
backport/backport-3229-to-3.6
Closed

[Backport 3.6] [Bug] Fix bug when dimension <= 56 in Faiss SQ.#3233
opensearch-trigger-bot[bot] wants to merge 6 commits into3.6from
backport/backport-3229-to-3.6

Conversation

@opensearch-trigger-bot
Copy link
Copy Markdown
Contributor

Backport 77ac70e from #3229

VijayanB and others added 6 commits March 26, 2026 10:06
- Route SpaceType.HAMMING to a dedicated createHammingScorer via
  FlatVectorsScorerProvider for memory-optimized binary vector search
- Propagate fieldInfo to byte-target createScorer APIs for
  space-type-aware scorer resolution

Signed-off-by: Vijayan Balasubramanian <balasvij@amazon.com>
Signed-off-by: Dooyong Kim <kdooyong@amazon.com>
#3217)

Signed-off-by: Navneet Verma <navneev@amazon.com>
Signed-off-by: Naveen Tatikonda <navtat@amazon.com>
#3207)

* Refactor ExactSearcher to use VectorScorer instead of ExactKNNIterator

Replace the ExactKNNIterator-based exact search with Lucene's VectorScorer
API, delegating scorer creation to VectorScorers factory. This eliminates
the need for multiple iterator subclasses (VectorIdsExactKNNIterator,
BinaryVectorIdsExactKNNIterator, and their nested variants) by using
VectorScorers.createScorer which handles vector type dispatch and nested
wrapping via NestedBestChildVectorScorer.

- Replace getKNNIterator with createVectorScorer using VectorScorers factory
- Use VectorScorerMode (SCORE/RESCORE) to control quantization path
- Remove getMatchedDocsIterator conjunction logic (handled by scorer)
- Remove direct dependency on KNNFloatVectorValues, KNNByteVectorValues,
  KNNBinaryVectorValues and all ExactKNNIterator subclasses

Signed-off-by: Vijayan Balasubramanian <balasvij@amazon.com>

* Use VectorScorer bulk scoring in ExactSearcher

Replace doc-by-doc iterator scoring with Lucene's VectorScorer.Bulk API
and DocAndFloatFeatureBuffer for batch processing. This enables batch
skipping when the max score of a batch is below the current threshold,
matching the pattern used in Lucene's AbstractKnnVectorQuery.exactSearch.

Signed-off-by: Vijayan Balasubramanian <balasvij@amazon.com>

* Fix ADC score calculation for cosine

Signed-off-by: Vijayan Balasubramanian <balasvij@amazon.com>

* Fix iterator index

Signed-off-by: Vijayan Balasubramanian <balasvij@amazon.com>

* Code clean up

Signed-off-by: Vijayan Balasubramanian <balasvij@amazon.com>

* Remove iterator previously used by exactsearcher

Signed-off-by: Vijayan Balasubramanian <balasvij@amazon.com>

* Add unit tests and clean up some more code

Signed-off-by: Vijayan Balasubramanian <balasvij@amazon.com>

---------

Signed-off-by: Vijayan Balasubramanian <balasvij@amazon.com>
Signed-off-by: Dooyong Kim <kdooyong@amazon.com>
@0ctopus13prime
Copy link
Copy Markdown
Collaborator

Ah, messed up git commit history, will manually raise a new backport PR

@0ctopus13prime 0ctopus13prime deleted the backport/backport-3229-to-3.6 branch March 31, 2026 00:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants