-
Notifications
You must be signed in to change notification settings - Fork 17
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
Changes from all commits
beeaf09
62de3bc
80907c7
406cbc7
c34c21b
a55575c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -120,6 +120,21 @@ package object query { | |
def innerHits(innerHits: InnerHits): Q | ||
} | ||
|
||
private[elasticsearch] trait HasMinimumShouldMatch[Q <: HasMinimumShouldMatch[Q]] { | ||
|
||
/** | ||
* Sets the `minimumShouldMatch` parameter for this [[ElasticQuery]]. The `minimumShouldMatch` value is the number | ||
* of should clauses returned documents must match. If the [[zio.elasticsearch.query.BoolQuery]] includes at least | ||
* one `should` clause and no `must`/`filter` clauses, the default value is 1. Otherwise, the default value is 0. | ||
* | ||
* @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 commentThe reason will be displayed to describe this comment to others. Learn more. If this applies only on There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 commentThe 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. |
||
*/ | ||
def minimumShouldMatch(value: Int): Q | ||
} | ||
|
||
private[elasticsearch] trait HasScoreMode[Q <: HasScoreMode[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.
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.