Skip to content

Fix max score calculation in MemorySegmentES91OSQVectorsScorer#132433

Merged
iverase merged 2 commits intoelastic:mainfrom
iverase:fixES91OSQVectorScorer
Aug 5, 2025
Merged

Fix max score calculation in MemorySegmentES91OSQVectorsScorer#132433
iverase merged 2 commits intoelastic:mainfrom
iverase:fixES91OSQVectorScorer

Conversation

@iverase
Copy link
Copy Markdown
Contributor

@iverase iverase commented Aug 5, 2025

There is an error in how we compute max score in our panamized version of ES91OSQVectorsScorer after #132293. This commit fixes it and increases test coverage.

@iverase iverase requested a review from benwtrent August 5, 2025 06:59
@elasticsearchmachine elasticsearchmachine added the Team:Search Relevance Meta label for the Search Relevance team in Elasticsearch label Aug 5, 2025
@elasticsearchmachine
Copy link
Copy Markdown
Collaborator

Pinging @elastic/es-search-relevance (Team:Search Relevance)

res = res.mul(-2).add(additionalCorrections).add(queryAdditionalCorrection).add(1f);
res = FloatVector.broadcast(FLOAT_SPECIES_128, 1).div(res).max(0);
maxScore = res.reduceLanes(VectorOperators.MAX);
maxScore = Math.max(maxScore, res.reduceLanes(VectorOperators.MAX));
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤦 yep! thanks!

Copy link
Copy Markdown
Member

@benwtrent benwtrent left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@iverase iverase merged commit 63e2a3b into elastic:main Aug 5, 2025
32 of 33 checks passed
@iverase iverase deleted the fixES91OSQVectorScorer branch August 5, 2025 11:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

>non-issue :Search Relevance/Vectors Vector search Team:Search Relevance Meta label for the Search Relevance team in Elasticsearch v9.2.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants