Skip to content

Backport can_match endpoint to 5.6 to allow 6.0 to use the optimization in mixed version #25704

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 2 commits into from
Jul 13, 2017

Conversation

s1monw
Copy link
Contributor

@s1monw s1monw commented Jul 13, 2017

6.0 applies some optimization to query rewriting if the number of shards
is large. In oder to make use of this optimization this commit adds the internal endpoint
to 5.6 such that a 6.0 coordinator node can make use of the feature even in a mixed cluster
or via cross cluster search.

Relates to #25658

@s1monw s1monw requested review from jpountz, jimczi and colings86 July 13, 2017 10:03
@s1monw s1monw added :Search/Search Search-related issues that do not fall into other categories v5.6.0 >enhancement review labels Jul 13, 2017
Copy link
Contributor

@colings86 colings86 left a comment

Choose a reason for hiding this comment

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

Found a small typo which looks like its in the master branch too but otherwise LGTM

@@ -293,8 +295,18 @@ public void writeTo(StreamOutput out) throws IOException {
}
}

public Builder addAggregators(AggregatorFactories factories) {
throw new UnsupportedOperationException("This needs to be removed");
public boolean mustVisiteAllDocs() {
Copy link
Contributor

Choose a reason for hiding this comment

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

typo: mustVisiteAllDocs --> mustVisitAllDocs?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ah that is also in master I will fix it there too

s1monw added a commit to s1monw/elasticsearch that referenced this pull request Jul 13, 2017
With cross cluster search we can potentially proxy `can_match` requests
to nodes that don't have the endpoint. This might not cause any problem
from a functional perspecitve but will cause ugly error messages on
the target node. This commit will cause an IAE if we try to talk to an
incompatible node via a proxy.

Relates to elastic#25704
Copy link
Contributor

@jimczi jimczi left a comment

Choose a reason for hiding this comment

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

LGTM too

s1monw added 2 commits July 13, 2017 14:58
…#25650)

In certain situations we can early terminate and just skip the entire
query phase or make the lucene level rewrite very cheap if we can already
tell that a query won't match any documents. For instance if there is a single
`match_none` ie. due to some range rewrite in a filter or must clause of a boolean
query it can just drop all it's other queries since it will never match.
…tion in mixed version

6.0 applies some optimization to query rewriting if the number of shards
is large. In oder to make use of this optimization this commit adds the internal endpoint
to 5.6 such that a 6.0 coordinator node can make use of the feature even in a mixed cluster
or via cross cluster search.

Relates to elastic#25658
@s1monw s1monw force-pushed the backport_can_match branch from d04500d to 9050c9e Compare July 13, 2017 12:58
@s1monw s1monw merged commit 9050c9e into elastic:5.x Jul 13, 2017
@s1monw s1monw deleted the backport_can_match branch July 13, 2017 12:59
s1monw added a commit that referenced this pull request Jul 13, 2017
With cross cluster search we can potentially proxy `can_match` requests
to nodes that don't have the endpoint. This might not cause any problem
from a functional perspecitve but will cause ugly error messages on
the target node. This commit will cause an IAE if we try to talk to an
incompatible node via a proxy.

Relates to #25704
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>enhancement :Search/Search Search-related issues that do not fall into other categories v5.6.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants