From ec43c53e718fe0d5dbbc9f49c97007576eccfc56 Mon Sep 17 00:00:00 2001 From: James Rodewig Date: Tue, 5 Nov 2019 08:40:38 -0500 Subject: [PATCH 1/2] [DOCS] Document `minimum_should_match` defaults for `bool` query 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 --- docs/reference/query-dsl/bool-query.asciidoc | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/docs/reference/query-dsl/bool-query.asciidoc b/docs/reference/query-dsl/bool-query.asciidoc index 2d84ff057415d..4ac3c0c324779 100644 --- a/docs/reference/query-dsl/bool-query.asciidoc +++ b/docs/reference/query-dsl/bool-query.asciidoc @@ -60,6 +60,18 @@ POST _search } -------------------------------------------------- +[[bool-min-should-match]] +==== Using `minimum_should_match` + +You can use the `minimum_should_match` parameter to specify the number or +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`. + +For other valid values, see the +<>. + [[score-bool-filter]] ==== Scoring with `bool.filter` From 35a41bf2004dff086fca19e0e3a67c6da651133a Mon Sep 17 00:00:00 2001 From: James Rodewig Date: Wed, 4 Dec 2019 10:27:46 -0500 Subject: [PATCH 2/2] address feedback --- docs/reference/query-dsl/bool-query.asciidoc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/reference/query-dsl/bool-query.asciidoc b/docs/reference/query-dsl/bool-query.asciidoc index 4ac3c0c324779..6594c982c44b7 100644 --- a/docs/reference/query-dsl/bool-query.asciidoc +++ b/docs/reference/query-dsl/bool-query.asciidoc @@ -66,8 +66,9 @@ POST _search You can use the `minimum_should_match` parameter to specify the number or 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`. +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`. For other valid values, see the <>.