# Minimum\_should\_match is not working

**URL:** <https://discuss.elastic.co/t/minimum-should-match-is-not-working/100068>\
**Category:** Kibana\
**Created:** [September 11, 2017, 1:38pm UTC](https://discuss.elastic.co/t/minimum-should-match-is-not-working/100068 "2017-09-11T13:38:22Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![kanchan](https://avatars.discourse-cdn.com/v4/letter/k/8797f3/32.png) [@kanchan](https://discuss.elastic.co/u/kanchan)\
**Post date:** [September 11, 2017, 1:38pm UTC](https://discuss.elastic.co/t/minimum-should-match-is-not-working/100068/1 "2017-09-11T13:38:22Z")

</div>

Hi,

I have used minimum\_should\_match as 10% or 80% both are giving same result.there is no difference in output.Please let me know why minimum\_should\_match is not working.

GET /hist\_latest/\_search  
{  
"query": {  
"bool": {  
"should": [  
{  
"multi\_match" : {  
"query": "Pravin MEH",  
"type": "best\_fields",  
"fields": ["bank\_client\_entity\_name"],  
"minimum\_should\_match": "80%"  
}  
}  
]  
}  
}  
}

---

<div class="post-metadata">

**Author:** ![Bargs](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bargs/32/5429_2.png) [@Bargs](https://discuss.elastic.co/u/Bargs)\
**Post date:** [September 11, 2017, 8:15pm UTC](https://discuss.elastic.co/t/minimum-should-match-is-not-working/100068/2 "2017-09-11T20:15:44Z")

</div>

Here's what I suspect is happening:

Assuming your analyzer splits on whitespace, your query only contains two terms: `Pravin` and `MEH`.

When you use percentages with `minimum_should_match`, the number computed from the percentage is rounded down and used as the minimum. Since you only have two terms, 10% of 2 is 0.2, which rounds down to 0. However, `minimum_should_match` will never use a value less than 1, so 10% becomes 1. 80% of 2 is 1.6, which rounds down to 1. So for this particular query with only two terms, 10% and 80% are equivalent. Try a query with more terms, or try 50% vs 100%.

---

<div class="post-metadata">

**Author:** ![kanchan](https://avatars.discourse-cdn.com/v4/letter/k/8797f3/32.png) [@kanchan](https://discuss.elastic.co/u/kanchan)\
**Post date:** [September 12, 2017, 6:45am UTC](https://discuss.elastic.co/t/minimum-should-match-is-not-working/100068/3 "2017-09-12T06:45:51Z")

</div>

Thanks, I understand the flow.but if I wanna to take character wise tokens and percent calculation on it.then how can I achieve it.

---

<div class="post-metadata">

**Author:** ![Bargs](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bargs/32/5429_2.png) [@Bargs](https://discuss.elastic.co/u/Bargs)\
**Post date:** [September 12, 2017, 3:58pm UTC](https://discuss.elastic.co/t/minimum-should-match-is-not-working/100068/4 "2017-09-12T15:58:45Z")

</div>

I don't understand, can you explain further?

---

<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:** [October 10, 2017, 4:33pm UTC](https://discuss.elastic.co/t/minimum-should-match-is-not-working/100068/5 "2017-10-10T16:33:41Z")

</div>

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