Skip to content

Updating exact long and scaled_float queries to make use of docvalues only when available #130088

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

Conversation

pmpailis
Copy link
Contributor

@pmpailis pmpailis commented Jun 26, 2025

Closes #129995

@pmpailis pmpailis added >bug :Search Relevance/Search Catch all for Search Relevance labels Jun 26, 2025
@elasticsearchmachine elasticsearchmachine added the Team:Search Relevance Meta label for the Search Relevance team in Elasticsearch label Jun 26, 2025
@elasticsearchmachine
Copy link
Collaborator

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

Copy link
Contributor

@iverase iverase left a comment

Choose a reason for hiding this comment

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

we did try this before (using IndexOrDocValues queries) and we had to revert it because it changes the way we count boolean clauses.

@@ -259,7 +259,7 @@ public boolean isSearchable() {
public Query termQuery(Object value, SearchExecutionContext context) {
failIfNotIndexedNorDocValuesFallback(context);
Copy link
Contributor

Choose a reason for hiding this comment

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

If it has no doc values, it should fail here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think that it needs to have both index: false and doc_values: false to fail here, and the default for numeric fields seems to be index: true

@pmpailis
Copy link
Contributor Author

we did try this before (using IndexOrDocValues queries) and we had to revert it because it changes the way we count boolean clauses.

Wasn't aware of that 😞 How did it affect the counts? Any other alternatives discussed at the time ?

@benwtrent
Copy link
Member

I think this is a better way to approach it: #130112

@pmpailis
Copy link
Contributor Author

Closing in favor of #130112

@pmpailis pmpailis closed this Jun 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>bug :Search Relevance/Search Catch all for Search Relevance Team:Search Relevance Meta label for the Search Relevance team in Elasticsearch v9.0.4
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Search queries result in an illegal_state_exception: unexpected docvalues type NONE for long and scaled_float fields with "doc_values": false
4 participants