Skip segment for MatchNoDocsQuery filters#98295
Merged
elasticsearchmachine merged 6 commits intoelastic:mainfrom Aug 10, 2023
Merged
Skip segment for MatchNoDocsQuery filters#98295elasticsearchmachine merged 6 commits intoelastic:mainfrom
MatchNoDocsQuery filters#98295elasticsearchmachine merged 6 commits intoelastic:mainfrom
Conversation
When a query of a filter gets rewritten to MatchNoDocsQuery, segments will not produce any results. We can therefore skip processing such segments. This applies to FilterByFilterAggregator and FiltersAggregator, as well as to TermsAggregator when it uses StringTermsAggregatorFromFilters internally; the latter is an adapter aggregator to FilterByFilterAggregator. Fixes elastic#94637
Collaborator
|
Hi @kkrik-es, I've created a changelog YAML for you. |
Member
Author
|
@elasticsearchmachine run elasticsearch-ci/part-2 |
Collaborator
|
Pinging @elastic/es-analytics-geo (Team:Analytics) |
martijnvg
reviewed
Aug 9, 2023
Member
martijnvg
left a comment
There was a problem hiding this comment.
Looks good, left a question.
server/src/main/java/org/elasticsearch/search/aggregations/bucket/filter/FiltersAggregator.java
Outdated
Show resolved
Hide resolved
.../main/java/org/elasticsearch/search/aggregations/bucket/filter/FilterByFilterAggregator.java
Outdated
Show resolved
Hide resolved
Member
Author
|
@elasticsearchmachine run elasticsearch-ci/part-3 |
Member
Author
|
@elasticsearchmachine run elasticsearch-ci/part-3 |
Member
Author
|
The optimization doesn't apply when |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When a query of a filter gets rewritten to
MatchNoDocsQuery, segments will not produce any results. We can therefore skip processing such segments.This applies to
FilterByFilterAggregatorandFiltersAggregator, as well as toTermsAggregatorwhen it usesStringTermsAggregatorFromFiltersinternally; the latter is an adapter aggregator wrappingFilterByFilterAggregator.Fixes #94637