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

Replace usages of deprecated specialized field exists queries #88312

Merged

Conversation

javanna
Copy link
Member

@javanna javanna commented Jul 6, 2022

DocValueFieldExistsQuery, NormsFieldExistsQuery as well as KnnVectorFieldExistsQuery are deprecated in Lucene in favour of FieldExistsQuery which combines the three into a single query.

This commit updates Elasticsearch to no longer rely on such deprecated queries.

see https://issues.apache.org/jira/browse/LUCENE-10436

DocValueFieldExistsQuery, NormsFieldExistsQuery as well as KnnVectorFieldExistsQuery are deprecated in Lucene in favour of FieldExistsQuery which combines the three into a single query.

This commit updates Elasticsearch to no longer rely on such deprecated queries.

see https://issues.apache.org/jira/browse/LUCENE-10436
@javanna javanna added :Search/Search Search-related issues that do not fall into other categories >tech debt v8.4.0 labels Jul 6, 2022
@elasticmachine elasticmachine added the Team:Search Meta label for search team label Jul 6, 2022
@elasticmachine
Copy link
Collaborator

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

@elasticsearchmachine
Copy link
Collaborator

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

@javanna javanna requested a review from romseygeek July 8, 2022 09:56
Copy link
Contributor

@romseygeek romseygeek left a comment

Choose a reason for hiding this comment

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

LGTM

@javanna javanna merged commit d3b1a61 into elastic:master Jul 8, 2022
javanna added a commit to javanna/elasticsearch that referenced this pull request Oct 4, 2022
When we switched to using the FieldExistsQuery (see elastic#88312) instead of the deprecated NormsFieldExistsQuery and
DocValuesFieldExistsQuery, we ended up shortcutting the total hit count for text fields to the doc count retrieved
from the terms enum. This does not take into account empty strings, as that converts to an empty token set for text
fields. In presence of text fields, we cannot shortcut, and this can be prevented by checking that the field has
doc_values. This was checked before indirectly by checking that the query is a DocValuesFieldExistsQuery.

Closes elastic#89760
javanna added a commit that referenced this pull request Oct 5, 2022
When we switched to using the FieldExistsQuery (see #88312) instead of the deprecated NormsFieldExistsQuery and
DocValuesFieldExistsQuery, we ended up shortcutting the total hit count for text fields to the doc count retrieved
from the terms enum. This does not take into account empty strings, as that converts to an empty token set for text
fields. In presence of text fields, we cannot shortcut, and this can be prevented by checking that the field has
doc_values. This was checked before indirectly by checking that the query is a DocValuesFieldExistsQuery.

Closes #89760
javanna added a commit to javanna/elasticsearch that referenced this pull request Oct 5, 2022
When we switched to using the FieldExistsQuery (see elastic#88312) instead of the deprecated NormsFieldExistsQuery and
DocValuesFieldExistsQuery, we ended up shortcutting the total hit count for text fields to the doc count retrieved
from the terms enum. This does not take into account empty strings, as that converts to an empty token set for text
fields. In presence of text fields, we cannot shortcut, and this can be prevented by checking that the field has
doc_values. This was checked before indirectly by checking that the query is a DocValuesFieldExistsQuery.

Closes elastic#89760
javanna added a commit that referenced this pull request Oct 5, 2022
When we switched to using the FieldExistsQuery (see #88312) instead of the deprecated NormsFieldExistsQuery and
DocValuesFieldExistsQuery, we ended up shortcutting the total hit count for text fields to the doc count retrieved
from the terms enum. This does not take into account empty strings, as that converts to an empty token set for text
fields. In presence of text fields, we cannot shortcut, and this can be prevented by checking that the field has
doc_values. This was checked before indirectly by checking that the query is a DocValuesFieldExistsQuery.

Closes #89760
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>refactoring :Search/Search Search-related issues that do not fall into other categories Team:Search Meta label for search team >tech debt v8.4.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants