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

Search option terminate_after does not handle post_filters and aggregations correctly #28459

Merged
merged 2 commits into from Feb 12, 2018

Conversation

Projects
None yet
2 participants
@jimczi
Copy link
Member

commented Jan 31, 2018

This change fixes the handling of the terminate_after option when post_filters (or min_score) are used.
post_filter should be applied before terminate_after in order to terminate the query when enough document are accepted by the filters.
This commit also changes the type of exception thrown by terminate_after in order to ensure that multi collectors (aggregations) do not try to continue the collection when enough documents have been collected.

Closes #28411

@jimczi

This comment has been minimized.

Copy link
Member Author

commented Feb 2, 2018

@colings86 I added a note regarding the usage of terminate_after with post_filter and aggs. Can you take a look ?

@colings86
Copy link
Member

left a comment

LGTM, thanks for adding the note to the docs

jimczi added some commits Jan 31, 2018

Search option terminate_after does not handle post_filters and aggreg…
…ations correctly

This change fixes the handling of the `terminate_after` option when post_filters (or min_score) are used.
`post_filter` should be applied before `terminate_after` in order to terminate the query when enough document are accepted
by the post_filters.
This commit also changes the type of exception thrown by `terminate_after` in order to ensure that multi collectors (aggregations)
do not try to continue the collection when enough documents have been collected.

Closes #28411

@jimczi jimczi force-pushed the jimczi:bug/terminate_after_with_filter branch to a431b36 Feb 12, 2018

@jimczi jimczi merged commit 7dc00ef into elastic:master Feb 12, 2018

2 checks passed

CLA Commit author is a member of Elasticsearch
Details
elasticsearch-ci Build finished.
Details

@jimczi jimczi deleted the jimczi:bug/terminate_after_with_filter branch Feb 12, 2018

jimczi added a commit that referenced this pull request Feb 12, 2018

Search option terminate_after does not handle post_filters and aggreg…
…ations correctly (#28459)

* Search option terminate_after does not handle post_filters and aggregations correctly

This change fixes the handling of the `terminate_after` option when post_filters (or min_score) are used.
`post_filter` should be applied before `terminate_after` in order to terminate the query when enough document are accepted
by the post_filters.
This commit also changes the type of exception thrown by `terminate_after` in order to ensure that multi collectors (aggregations)
do not try to continue the collection when enough documents have been collected.

Closes #28411

@colings86 colings86 added v7.0.0-beta1 and removed v7.0.0 labels Feb 7, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.