# What is the upper limit on index.query.bool.max\_clause\_count for different ES versions?

**URL:** <https://discuss.elastic.co/t/what-is-the-upper-limit-on-index-query-bool-max-clause-count-for-different-es-versions/92892>\
**Category:** Elasticsearch\
**Created:** [July 12, 2017, 10:39pm UTC](https://discuss.elastic.co/t/what-is-the-upper-limit-on-index-query-bool-max-clause-count-for-different-es-versions/92892 "2017-07-12T22:39:13Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![abzter10690](https://avatars.discourse-cdn.com/v4/letter/a/a9adbd/32.png) [@abzter10690](https://discuss.elastic.co/u/abzter10690)\
**Post date:** [July 12, 2017, 10:39pm UTC](https://discuss.elastic.co/t/what-is-the-upper-limit-on-index-query-bool-max-clause-count-for-different-es-versions/92892/1 "2017-07-12T22:39:14Z")

</div>

What is the maximum that we can set for index.query.bool.max\_clause\_count(old versions) and indices.query.bool.max\_clause\_count (\>5.1)?

---

<div class="post-metadata">

**Author:** ![geekpete](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/geekpete/32/20409_2.png) [@geekpete](https://discuss.elastic.co/u/geekpete)\
**Post date:** [July 26, 2017, 2:35pm UTC](https://discuss.elastic.co/t/what-is-the-upper-limit-on-index-query-bool-max-clause-count-for-different-es-versions/92892/2 "2017-07-26T14:35:15Z")

</div>

Hi Abbas,

I believe it's 1024 in versions \>5.1

Though I'd like to help by finding out how you're hitting this limit.  
If you only need to filter docs with a bool query, then perhaps you can do a bool filter instead of a bool must.  
~~This would avoid this max setting as this setting is specific to scoring so shouldn't apply to filtering.~~  
It depends if you need to score each document though.

Most cases I've seen where this has been hit have been filtering scenarios rather than scoring ones.

**CORRECTION** : Using a bool filter instead of a bool must will still hit the same max clause limit if you use more than the maximum number of clauses in your bool filter.

---

<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:** [August 23, 2017, 2:35pm UTC](https://discuss.elastic.co/t/what-is-the-upper-limit-on-index-query-bool-max-clause-count-for-different-es-versions/92892/3 "2017-08-23T14:35:39Z")

</div>

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