Skip to content

Introduce VectorScorers to create VectorScorer instances based on the underlying vector storage format#3183

Open
VijayanB wants to merge 1 commit intoopensearch-project:mainfrom
VijayanB:add-scorer-factory
Open

Introduce VectorScorers to create VectorScorer instances based on the underlying vector storage format#3183
VijayanB wants to merge 1 commit intoopensearch-project:mainfrom
VijayanB:add-scorer-factory

Conversation

@VijayanB
Copy link
Member

@VijayanB VijayanB commented Mar 18, 2026

Description

Introduce VectorScorerFactory to create VectorScorer instances based on
the underlying vector storage format (BinaryDocValues, FloatVectorValues,
ByteVectorValues). Add ScoreMode interface to abstract scorer vs rescorer
creation.

  • Add ScoreMode with SCORE and RESCORE strategies
  • Add VectorScorerFactory with float and byte target overloads
  • Add ADC scorer with TODO to remove once ByteVectorValues.scorer() is implemented

Related Issues

Resolves #[Issue number to be closed when this PR is merged]

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.

@codecov
Copy link

codecov bot commented Mar 18, 2026

Codecov Report

❌ Patch coverage is 95.00000% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 82.68%. Comparing base (6c4d427) to head (02ec458).

Files with missing lines Patch % Lines
...nsearch/knn/index/query/scorers/VectorScorers.java 93.93% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #3183      +/-   ##
============================================
+ Coverage     82.66%   82.68%   +0.01%     
- Complexity     3980     3993      +13     
============================================
  Files           431      433       +2     
  Lines         14783    14822      +39     
  Branches       1882     1887       +5     
============================================
+ Hits          12221    12255      +34     
- Misses         1801     1807       +6     
+ Partials        761      760       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@VijayanB VijayanB force-pushed the add-scorer-factory branch 2 times, most recently from 15f917a to 98bc52e Compare March 18, 2026 17:00
@VijayanB VijayanB changed the title Add VectorScorerFactory, ScoreMode and unit tests for exact search scoring Introduce VectorScorerFactory to create VectorScorer instances based on the underlying vector storage format Mar 18, 2026
@VijayanB VijayanB marked this pull request as ready for review March 18, 2026 17:06
@VijayanB
Copy link
Member Author

This is based on #3179 . Once the other PR is merged, will rebase again.

@VijayanB VijayanB changed the title Introduce VectorScorerFactory to create VectorScorer instances based on the underlying vector storage format Introduce VectorScorers to create VectorScorer instances based on the underlying vector storage format Mar 18, 2026
Copy link
Collaborator

@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.

I am confused on this PR , Please re-bases the have only changes which was not there in Last one.

…oring

Introduce VectorScorerFactory to create VectorScorer instances based on
the underlying vector storage format (BinaryDocValues, FloatVectorValues,
ByteVectorValues). Add ScoreMode interface to abstract scorer vs rescorer
creation.

- Add ScoreMode with SCORE and RESCORE strategies
- Add VectorScorerFactory with float and byte target overloads
- Add ADC scorer with TODO to remove once ByteVectorValues.scorer() is implemented

Signed-off-by: Vijayan Balasubramanian <balasvij@amazon.com>
@VijayanB VijayanB force-pushed the add-scorer-factory branch from 358683d to 02ec458 Compare March 18, 2026 19:33
@VijayanB VijayanB requested a review from Vikasht34 March 18, 2026 21:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants