# Control number of search terms in bool query

**URL:** <https://discuss.elastic.co/t/control-number-of-search-terms-in-bool-query/47213>\
**Category:** Elasticsearch\
**Created:** [April 13, 2016, 8:05am UTC](https://discuss.elastic.co/t/control-number-of-search-terms-in-bool-query/47213 "2016-04-13T08:05:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![neethu](https://avatars.discourse-cdn.com/v4/letter/n/58956e/32.png) [@neethu](https://discuss.elastic.co/u/neethu)\
**Post date:** [April 13, 2016, 8:05am UTC](https://discuss.elastic.co/t/control-number-of-search-terms-in-bool-query/47213/1 "2016-04-13T08:05:35Z")

</div>

I have a bool query like this.And i have a data in my elastic DB as "Airport random disconnect".  
While i am querying with the term " First random term" i am getting the output as

Community :: AirPort  
Title :: Airport random disconnect  
Geo :: English  
Score:: 5.7417393  
The word random is present only once in the phrase.I need the document to be selected only if more than 3 matches are there in the title.

how can i change my query..  
Please help

{  
"bool" : {  
"must" : [ {  
"match" : {  
"title" : {  
"query" : "random",  
"type" : "boolean",  
"minimum\_should\_match" : "3"  
}  
}  
}, {  
"match" : {  
"geo" : {  
"query" : "English",  
"type" : "boolean"  
}  
}  
} ]  
}  
}

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [April 14, 2016, 1:48pm UTC](https://discuss.elastic.co/t/control-number-of-search-terms-in-bool-query/47213/2 "2016-04-14T13:48:42Z")

</div>

Hey,

can you please a fully fledged example that shows hwo you create an index, create the mapping, index a document and fire the query in order to follow what steps you did. Tested this locally and works as expected, so let's see where the difference it.

--Alex

---

<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:** [July 5, 2017, 10:59pm UTC](https://discuss.elastic.co/t/control-number-of-search-terms-in-bool-query/47213/3 "2017-07-05T22:59:14Z")

</div>


