-
Notifications
You must be signed in to change notification settings - Fork 25k
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
Add minimum_should_match
section to the Query String Query documentation (#34142)
#36109
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.
Thanks @cbismuth , I left some comments
analyzed entirely. One query is created for each field and finally the field | ||
queries are merged into a single query. When the final query is a boolean query | ||
with a single clause which is the disjunction max over the fields, the | ||
`minimum_should_match` parameter can't be applied. |
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.
I think you can replace this by:
The `query_string` splits the query around each operator to create a boolean query for the entire input. You can use `minimum_should_match` to controll how many "should" clauses in the resulting query should match.
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.
Yes, that's easier to read, fixed in d2a3ec6.
|
||
that matches documents with at least two of the terms `this`, `that` or `thus` | ||
in the single field `title`. | ||
|
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.
You can maybe start a sub-section for the multi-fields example ?
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.
Totally, fixed in 877d7a2.
`((content:this content:that content:thus) | (title:this title:that title:thus))` | ||
|
||
that matches documents with the disjunction max over the fields `title` and | ||
`content`. Here the `minimum_should_match` parameter can't be applied. |
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.
You can mention here that adding explicit operators forces each term to be considered as a separate clause.
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.
Yes, done in 8cacbe4.
`((content:this | title:this) (content:that | title:that) (content:thus | title:thus))~2` | ||
|
||
that matches documents with at least two of the three `SHOULD` clauses, each of | ||
them made of the disjunction max over the fields for each term. |
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.
We can also mention the "type": "cross_fields"
option for fields that share the same analyzer ?
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.
@elasticmachine test this please |
@elasticmachine test this please |
3 similar comments
@elasticmachine test this please |
@elasticmachine test this please |
@elasticmachine test this please |
Hi, it seems we have a CI-related issue:
|
We're in the process of investigating on our side, thanks. |
Great, thank you @jasontedor 👍 |
This issue should be addressed now. @elasticsearch test this please |
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.
LGTM, thanks @cbismuth
Pinging @elastic/es-search |
That is great, thanks @jimczi and @jasontedor 👍 |
This PR adds a section to the Query String Query documentation to explain why the
minimum_should_match
parameter isn't applied when the final boolean query is a disjunction max over multiple fields.