# Problems using Boolean expressions with minimum\_should\_match in query\_string query

**URL:** <https://discuss.elastic.co/t/problems-using-boolean-expressions-with-minimum-should-match-in-query-string-query/96095>\
**Category:** Elasticsearch\
**Created:** [August 7, 2017, 11:53am UTC](https://discuss.elastic.co/t/problems-using-boolean-expressions-with-minimum-should-match-in-query-string-query/96095 "2017-08-07T11:53:16Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jonben](https://avatars.discourse-cdn.com/v4/letter/j/a6a055/32.png) [@jonben](https://discuss.elastic.co/u/jonben)\
**Post date:** [August 7, 2017, 11:53am UTC](https://discuss.elastic.co/t/problems-using-boolean-expressions-with-minimum-should-match-in-query-string-query/96095/1 "2017-08-07T11:53:16Z")

</div>

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"]  
}  
}  
}

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [September 4, 2017, 11:53am UTC](https://discuss.elastic.co/t/problems-using-boolean-expressions-with-minimum-should-match-in-query-string-query/96095/2 "2017-09-04T11:53:16Z")

</div>

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