Does wrapping single Elasticsearch queries in bool must queries change search results, or are the following two queries identical (both in terms of how elasticsearch processes them and what the outcome is)?
single query_string
query (no bool
query as wrapper):
POST _search
{
"query": {
"query_string" : { "query" : "My query string" }
}}
bool
query that wrapps a single query_string
query:
POST _search
{
"query": {
"bool" : {
"must" : {
"query_string" : { "query" : "My query string" }
}}}}
Both are exactly semantically the same and will produce the same results.
It's worth noting, though, that a bool
query only makes sense if there are more than one clause, otherwise it's useless to specify it.