# Why minimun\_should\_match must not be lower than 1?

**URL:** <https://discuss.elastic.co/t/why-minimun-should-match-must-not-be-lower-than-1/70342>\
**Category:** Elasticsearch\
**Created:** [January 2, 2017, 8:58am UTC](https://discuss.elastic.co/t/why-minimun-should-match-must-not-be-lower-than-1/70342 "2017-01-02T08:58:45Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Florian\_Wilhelm](https://avatars.discourse-cdn.com/v4/letter/f/e36b37/32.png) [@Florian\_Wilhelm](https://discuss.elastic.co/u/Florian_Wilhelm)\
**Post date:** [January 2, 2017, 8:58am UTC](https://discuss.elastic.co/t/why-minimun-should-match-must-not-be-lower-than-1/70342/1 "2017-01-02T08:58:45Z")

</div>

In the documentation of the `minimum_should_match` parameter of the `bool` query it is stated

> ... the minimum number of required matches will never be lower than 1 or greater than the number of clauses.

Why is this restriction enforced? What if I use the `must` part of `bool` for everything I really want and `should` for purely optional requirements. BTW, it is still possible to circumvent the restriction that `minimum_should_match` must be greater or equal than 1 if it is an integer by adding and additional should clause that fits just everything like:

```
{
    "constant_score": {
        "boost": 0,
        "filter": {
            "match_all": {}
         }
     }
},

```

So why not get completely rid of that by allowing `"minimum_should_match": 0`?

---

<div class="post-metadata">

**Author:** ![cbuescher](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cbuescher/32/60402_2.png) [@cbuescher](https://discuss.elastic.co/u/cbuescher)\
**Post date:** [January 2, 2017, 11:54am UTC](https://discuss.elastic.co/t/why-minimun-should-match-must-not-be-lower-than-1/70342/2 "2017-01-02T11:54:28Z")

</div>

Hi,

If you are refering to the reference for [Minimum Should Match](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/query-dsl-minimum-should-match.html), I think the statement only applies to cases where there is a calculation involved (e.g. percentages). You should be able to use `"minimum_should_match" : 0` (which is equivalent to having no "minimum\_should\_match" restriction) and you will get all documents matching the requiered "must" clauses, with the ones where the "should" clauses match with a higher score.  
Negative values also work as described in the reference mentioned above.

---

<div class="post-metadata">

**Author:** ![Florian\_Wilhelm](https://avatars.discourse-cdn.com/v4/letter/f/e36b37/32.png) [@Florian\_Wilhelm](https://discuss.elastic.co/u/Florian_Wilhelm)\
**Post date:** [January 2, 2017, 1:19pm UTC](https://discuss.elastic.co/t/why-minimun-should-match-must-not-be-lower-than-1/70342/3 "2017-01-02T13:19:35Z")

</div>

Hi,

thanks for your reply. You are right that it works if I set `minimum_should_match` to 0 but I wasn't sure what it was doing internally. If it is like you are saying and the statement about the minimum of 1 only applies in the case of calculations, it's exactly what I want.  
Thanks.

---

<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:** [January 30, 2017, 1:19pm UTC](https://discuss.elastic.co/t/why-minimun-should-match-must-not-be-lower-than-1/70342/4 "2017-01-30T13:19:50Z")

</div>

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