Skip to content

Fix NPE in flat_bbq scorer when all vectors are missing #129548

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

Merged
merged 7 commits into from
Jun 17, 2025

Conversation

benwtrent
Copy link
Member

It is possible to get all the way down to the knn format reader and there be no vectors in the index.

This execution path is possible if utilizing nested queries (which bypasses the higher level checks in KnnFloatVectorQuery#approximateSearch).

bbq_flat should check for the existence of vectors before attempting to create the scorer.

@elasticsearchmachine elasticsearchmachine added the Team:Search Relevance Meta label for the Search Relevance team in Elasticsearch label Jun 17, 2025
@elasticsearchmachine
Copy link
Collaborator

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

@elasticsearchmachine
Copy link
Collaborator

Hi @benwtrent, I've created a changelog YAML for you.

@benwtrent benwtrent added the auto-backport Automatically create backport pull requests when merged label Jun 17, 2025
Copy link
Contributor

@john-wagster john-wagster left a comment

Choose a reason for hiding this comment

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

lgtm

@benwtrent benwtrent added auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) labels Jun 17, 2025
Copy link
Contributor

@ChrisHegarty ChrisHegarty left a comment

Choose a reason for hiding this comment

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

LGTM

@elasticsearchmachine elasticsearchmachine merged commit 80667d0 into elastic:main Jun 17, 2025
27 checks passed
@benwtrent benwtrent deleted the npe-bugfix-bbq_flat branch June 17, 2025 21:39
@elasticsearchmachine
Copy link
Collaborator

💔 Backport failed

Status Branch Result
8.19 Commit could not be cherrypicked due to conflicts
9.0 Commit could not be cherrypicked due to conflicts
8.18 Commit could not be cherrypicked due to conflicts

You can use sqren/backport to manually backport by running backport --upstream elastic/elasticsearch --pr 129548

benwtrent added a commit to benwtrent/elasticsearch that referenced this pull request Jun 18, 2025
It is possible to get all the way down to the knn format reader and
there be no vectors in the index.

This execution path is possible if utilizing nested queries (which
bypasses the higher level checks in
`KnnFloatVectorQuery#approximateSearch`).

bbq_flat should check for the existence of vectors before attempting to
create the scorer.

(cherry picked from commit 80667d0)
@benwtrent
Copy link
Member Author

💚 All backports created successfully

Status Branch Result
9.0
8.19
8.18

Questions ?

Please refer to the Backport tool documentation

benwtrent added a commit to benwtrent/elasticsearch that referenced this pull request Jun 18, 2025
It is possible to get all the way down to the knn format reader and
there be no vectors in the index.

This execution path is possible if utilizing nested queries (which
bypasses the higher level checks in
`KnnFloatVectorQuery#approximateSearch`).

bbq_flat should check for the existence of vectors before attempting to
create the scorer.

(cherry picked from commit 80667d0)
elasticsearchmachine pushed a commit that referenced this pull request Jun 18, 2025
… (#129623)

* Fix NPE in flat_bbq scorer when all vectors are missing (#129548)

It is possible to get all the way down to the knn format reader and
there be no vectors in the index.

This execution path is possible if utilizing nested queries (which
bypasses the higher level checks in
`KnnFloatVectorQuery#approximateSearch`).

bbq_flat should check for the existence of vectors before attempting to
create the scorer.

(cherry picked from commit 80667d0)

* fixing comp
elasticsearchmachine pushed a commit that referenced this pull request Jun 18, 2025
…) (#129624)

* Fix NPE in flat_bbq scorer when all vectors are missing (#129548)

It is possible to get all the way down to the knn format reader and
there be no vectors in the index.

This execution path is possible if utilizing nested queries (which
bypasses the higher level checks in
`KnnFloatVectorQuery#approximateSearch`).

bbq_flat should check for the existence of vectors before attempting to
create the scorer.

(cherry picked from commit 80667d0)

* fixing comp
elasticsearchmachine pushed a commit that referenced this pull request Jun 18, 2025
…) (#129625)

* Fix NPE in flat_bbq scorer when all vectors are missing (#129548)

It is possible to get all the way down to the knn format reader and
there be no vectors in the index.

This execution path is possible if utilizing nested queries (which
bypasses the higher level checks in
`KnnFloatVectorQuery#approximateSearch`).

bbq_flat should check for the existence of vectors before attempting to
create the scorer.

(cherry picked from commit 80667d0)

* fixing compilation
kderusso pushed a commit to kderusso/elasticsearch that referenced this pull request Jun 23, 2025
It is possible to get all the way down to the knn format reader and
there be no vectors in the index. 

This execution path is possible if utilizing nested queries (which
bypasses the higher level checks in
`KnnFloatVectorQuery#approximateSearch`).

bbq_flat should check for the existence of vectors before attempting to
create the scorer.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-backport Automatically create backport pull requests when merged auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) >bug :Search Relevance/Vectors Vector search Team:Search Relevance Meta label for the Search Relevance team in Elasticsearch v8.18.3 v8.19.0 v9.0.3 v9.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants