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

Do not apply minimum-should-match on a boolean query if the coords are disabled #16078

Merged
merged 1 commit into from Jan 19, 2016

Conversation

Projects
None yet
2 participants
@jimczi
Copy link
Member

jimczi commented Jan 19, 2016

Fixes #15858

@@ -117,6 +117,9 @@ public static Query applyMinimumShouldMatch(BooleanQuery query, @Nullable String
if (minimumShouldMatch == null) {
return query;
}
if (query.isCoordDisabled()) {

This comment has been minimized.

Copy link
@jpountz

jpountz Jan 19, 2016

Contributor

can you leave a comment to explain that this means that this booleanquery was generated from synonyms?

@jpountz

This comment has been minimized.

Copy link
Contributor

jpountz commented Jan 19, 2016

@jimferenczi I suspect that this does not fully address #15858. For instance if you pass a min should match of 2 on a match query that only emits a asingle term then the min should match will simply be ignored?

@jimczi

This comment has been minimized.

Copy link
Member Author

jimczi commented Jan 19, 2016

@jpountz yes but not because of this commit, a match query that emits a single term is translated into a TermQuery and not a BooleanQuery. The match query builder ignores TermQuery (and any Query that is not a BooleanQuery after parsing) when the minimum should match is applied.

@jpountz

This comment has been minimized.

Copy link
Contributor

jpountz commented Jan 19, 2016

OK, so let's merge this in and work on another PR to make the min should match apply in all cases?

jimczi added a commit that referenced this pull request Jan 19, 2016

Merge pull request #16078 from jimferenczi/mss_synonym
Do not apply minimum-should-match on a boolean query if the coords are disabled

@jimczi jimczi merged commit 12df1e7 into elastic:master Jan 19, 2016

1 check passed

CLA Commit author is a member of Elasticsearch
Details

@jimczi jimczi deleted the jimczi:mss_synonym branch Jan 19, 2016

@jpountz

This comment has been minimized.

Could you leave a comment that disabled coords mean that this BQ is for synonyms?

This comment has been minimized.

Copy link
Member Author

jimczi replied Jan 19, 2016

Oups it's already merged. I'll commit directly in master.

This comment has been minimized.

Copy link
Contributor

jpountz replied Jan 19, 2016

Thanks.

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.