I was following the guide here https://dzone.com/articles/23-useful-elasticsearch-example-queries and the bool query below confuses me:
{
"query": {
"bool": {
"must": {
"bool" : { "should": [
{ "match": { "title": "Elasticsearch" }},
{ "match": { "title": "Solr" }} ] }
},
"must": { "match": { "authors": "clinton gormely" }},
"must_not": { "match": {"authors": "radu gheorge" }}
}
}
}
According to the tutorial, the explanation of the query is:
Search for a book with the word “Elasticsearch” OR “Solr” in the title, AND is authored by “clinton gormley” but NOT authored by “radu gheorge”
My question is, there are 3 conditions but also 3 logical operator in the bool query (must, must, must_not) instead of 2. My understanding is that 3 conditions should only have 2 logical operator like COND1 AND COND2 AND !COND3
.
Is there something I am missing here?