Skip to content

Conversation

jrodewig
Copy link
Contributor

@jrodewig jrodewig commented Nov 5, 2019

Adds documentation for the minimum_should_match parameter to the
bool query docs. Includes docs for the default values:

  • 1 if the bool query only includes should clauses
  • 0 if the bool query includes any other type of clauses

Adds documentation for the `minimum_should_match` parameter to the
`bool` query docs. Includes docs for the default values:

- `1` if the `bool` query only includes `should` clauses
- `0` if the `bool` query includes any other type of clauses
@jrodewig jrodewig added >docs General docs changes :Search/Search Search-related issues that do not fall into other categories v8.0.0 v7.5.0 v7.6.0 v6.8.5 v7.4.3 labels Nov 5, 2019
@jrodewig jrodewig requested review from colings86 and jpountz November 5, 2019 13:45
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-search (:Search/Search)

@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-docs (>docs)

@jimczi jimczi removed the v7.5.0 label Nov 12, 2019
@jaymode jaymode added v6.8.6 and removed v6.8.5 labels Nov 19, 2019
@jrodewig jrodewig added v7.5.1 and removed v7.4.3 labels Dec 2, 2019
@jrodewig
Copy link
Contributor Author

jrodewig commented Dec 2, 2019

@jpountz Can you let me know what you think of these changes when convenient? Thank you!

Copy link
Contributor

@jpountz jpountz left a comment

Choose a reason for hiding this comment

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

Sorry for missing the review on this PR. I left a suggestion, I wish the default value of this parameter was not that complicated... Thanks for documenting it!

percentage of `should` clauses returned documents _must_ match.

If the `bool` query includes only `should` clauses, the default value is `1`.
If the `bool` query includes any other type of clause, the default value is `0`.
Copy link
Contributor

Choose a reason for hiding this comment

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

It doesn't cover the case when a bool query includes should and must_not clauses, when the default value would still be 1. The below description would be closer to how we choose the default internally (I wish it was not that complicated).

If the `bool` query includes at least one `should` clause and no `must` or `filter` clauses, the default value is `1`.
Otherwise, the default value is `0`.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the clarification @jpountz. I've updated this section as you suggested with 35a41bf.

@jrodewig jrodewig requested a review from jpountz December 4, 2019 15:44
@jrodewig jrodewig merged commit 72dd49d into elastic:master Dec 4, 2019
@jrodewig jrodewig deleted the bool-min-should-match branch December 4, 2019 17:44
jrodewig added a commit that referenced this pull request Dec 4, 2019
)

Adds documentation for the `minimum_should_match` parameter to the `bool` query docs. Includes docs for the default values:

- `1` if the `bool` query includes at least one `should` clause and no `must` or `filter` clauses
- `0` otherwise
jrodewig added a commit that referenced this pull request Dec 4, 2019
)

Adds documentation for the `minimum_should_match` parameter to the `bool` query docs. Includes docs for the default values:

- `1` if the `bool` query includes at least one `should` clause and no `must` or `filter` clauses
- `0` otherwise
jrodewig added a commit that referenced this pull request Dec 4, 2019
)

Adds documentation for the `minimum_should_match` parameter to the `bool` query docs. Includes docs for the default values:

- `1` if the `bool` query includes at least one `should` clause and no `must` or `filter` clauses
- `0` otherwise
@jrodewig
Copy link
Contributor Author

jrodewig commented Dec 4, 2019

Backport commits

@ChenJhua
Copy link

ChenJhua commented Jan 7, 2020

when i use es7.1.1, only one should,butminimum_should_match default is 0,es6 to es7, why change this default value, I have a lot of should code because the upgrade requires a change

SivagurunathanV pushed a commit to SivagurunathanV/elasticsearch that referenced this pull request Jan 23, 2020
…stic#48865)

Adds documentation for the `minimum_should_match` parameter to the `bool` query docs. Includes docs for the default values:

- `1` if the `bool` query includes at least one `should` clause and no `must` or `filter` clauses
- `0` otherwise
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

>docs General docs changes :Search/Search Search-related issues that do not fall into other categories v6.8.6 v7.5.1 v7.6.0 v8.0.0-alpha1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants