| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 | [[query-dsl-bool-query]]=== Bool QueryA query that matches documents matching boolean combinations of otherqueries. The bool query maps to Lucene `BooleanQuery`. It is built usingone or more boolean clauses, each clause with a typed occurrence. Theoccurrence types are:[cols="<,<",options="header",]|=======================================================================|Occur |Description|`must` |The clause (query) must appear in matching documents.|`should` |The clause (query) should appear in the matching document. Ina boolean query with no `must` clauses, one or more `should` clausesmust match a document. The minimum number of should clauses to match canbe set using the<<query-dsl-minimum-should-match,`minimum_should_match`>>parameter.|`must_not` |The clause (query) must not appear in the matchingdocuments.|=======================================================================The bool query also supports `disable_coord` parameter (defaults to`false`). Basically the coord similarity computes a score factor basedon the fraction of all query terms that a document contains. See Lucene`BooleanQuery` for more details.The `bool` query takes a _more-matches-is-better_ approach, so the score fromeach matching `must` or `should` clause will be added together to provide the final `_score` for each document.[source,js]--------------------------------------------------{    "bool" : {        "must" : {            "term" : { "user" : "kimchy" }        },        "must_not" : {            "range" : {                "age" : { "from" : 10, "to" : 20 }            }        },        "should" : [            {                "term" : { "tag" : "wow" }            },            {                "term" : { "tag" : "elasticsearch" }            }        ],        "minimum_should_match" : 1,        "boost" : 1.0    }}--------------------------------------------------
 |