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

SimpleText[Float|Byte]VectorValues::scorer should return null when the vector values is empty #13444

Merged
merged 2 commits into from
May 31, 2024

Conversation

ChrisHegarty
Copy link
Contributor

This commit ensures that SimpleText[Float|Byte]VectorValues::scorer returns null when the vector values is empty, as per the scorer javadoc. Other KnnVectorsReader implementations have specialised empty implementations that do similar, e.g. OffHeapFloatVectorValues.EmptyOffHeapVectorValues. The VectorScorer interface in new in Lucene 9.11, see #13181

An existing test randomly hits this, but a new test has been added that exercises this code path consistently. It's also useful to verify other KnnVectorsReader implementations.

closes #13443

@ChrisHegarty ChrisHegarty added this to the 9.11.0 milestone May 31, 2024
@ChrisHegarty ChrisHegarty merged commit f3c2b91 into apache:main May 31, 2024
3 checks passed
@ChrisHegarty ChrisHegarty deleted the simpleText_empty_vv branch May 31, 2024 13:30
ChrisHegarty added a commit that referenced this pull request May 31, 2024
…e vector values is empty (#13444)

This commit ensures that SimpleText[Float|Byte]VectorValues::scorer returns null when the vector values is empty, as per the scorer javadoc. Other KnnVectorsReader implementations have specialised empty implementations that do similar, e.g. OffHeapFloatVectorValues.EmptyOffHeapVectorValues. The VectorScorer interface in new in Lucene 9.11, see #13181

An existing test randomly hits this, but a new test has been added that exercises this code path consistently. It's also useful to verify other KnnVectorsReader implementations.
ChrisHegarty added a commit that referenced this pull request May 31, 2024
…e vector values is empty (#13444)

This commit ensures that SimpleText[Float|Byte]VectorValues::scorer returns null when the vector values is empty, as per the scorer javadoc. Other KnnVectorsReader implementations have specialised empty implementations that do similar, e.g. OffHeapFloatVectorValues.EmptyOffHeapVectorValues. The VectorScorer interface in new in Lucene 9.11, see #13181

An existing test randomly hits this, but a new test has been added that exercises this code path consistently. It's also useful to verify other KnnVectorsReader implementations.
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.

Reproducible failure TestSimpleTextKnnVectorsFormat.testFloatVectorScorerIteration
2 participants