Problems using Boolean expressions with minimum_should_match in query_string query


#1

I get the impression that Boolean operators are ignored/not working properly in a query_string query when using minimum_should_match. Is this a bug, or is Boolean operators not to be used in query_string queries together with minimum_should_match?

Elasticsearch version: 5.5.1


Index content:

[
{
"_index": "index1",
"_type": "type1",
"_id": "doc1",
"_score": 1,
"_source": {
"field1": "aaa"
}
},
{
"_index": "index1",
"_type": "type1",
"_id": "doc2",
"_score": 1,
"_source": {
"field1": "bbb"
}
}
]


The following search returns 0 hits:

GET index1/_search
{
"query": {
"query_string": {
"query": "(bbb OR aaa)",
"minimum_should_match": "100%",
"fields": ["field1"]
}
}
}


I would have expected it to return both of the indexed documents as hits, which I get if I use a query_string query with default operator "AND":

GET index1/_search
{
"query": {
"query_string": {
"query": "(bbb OR aaa)",
"default_operator": "AND",
"fields": ["field1"]
}
}
}


(system) #2

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.