-
Notifications
You must be signed in to change notification settings - Fork 18
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
Support minimumShouldMatch
on BoolQuery
#184
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should add test to check if it is written in file successfully?
Also it would be nice to have one integration test.
def minimumShouldMatch(value: Int): BoolQuery[S] = | ||
self.copy(minimumShouldMatch = Some(value)) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move this after mustNot
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorted alphabetically.
@@ -120,6 +120,21 @@ package object query { | |||
def innerHits(innerHits: InnerHits): Q | |||
} | |||
|
|||
private[elasticsearch] trait HasMinimumShouldMatch[Q <: HasBoost[Q]] { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
private[elasticsearch] trait HasMinimumShouldMatch[Q <: HasBoost[Q]] { | |
private[elasticsearch] trait HasMinimumShouldMatch[Q <: HasMinimumShouldMatch[Q]] { |
* @param value | ||
* a number to set `minimumShouldMatch` parameter to | ||
* @return | ||
* a new instance of the [[ElasticQuery]] with the `minimumShouldMatch` value set. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this applies only on BoolQuery
, maybe write it here instead of ElasticQuery
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if there are any other places to be supported.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At least match bool prefix query supports this. So, let's have it in a separate trait.
Description:
minimumShouldMatch
support forBoolQuery
.paramsToJson
andtoJson
methods as package private.minimumShouldMatch
is successfully set.