# Too\_many\_clauses: maxClauseCount is set to 1024 & index.query.bool.max\_clause\_count

**URL:** <https://discuss.elastic.co/t/too-many-clauses-maxclausecount-is-set-to-1024-index-query-bool-max-clause-count/181443>\
**Category:** Elasticsearch\
**Created:** [May 16, 2019, 3:35pm UTC](https://discuss.elastic.co/t/too-many-clauses-maxclausecount-is-set-to-1024-index-query-bool-max-clause-count/181443 "2019-05-16T15:35:21Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![alexus](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/alexus/32/12696_2.png) [@alexus](https://discuss.elastic.co/u/alexus)\
**Post date:** [May 16, 2019, 3:35pm UTC](https://discuss.elastic.co/t/too-many-clauses-maxclausecount-is-set-to-1024-index-query-bool-max-clause-count/181443/1 "2019-05-16T15:35:21Z")

</div>

Hello World!

I'm running into following error:

> ```
> {
> "type": "too_many_clauses",
> "reason": "too_many_clauses: maxClauseCount is set to 1024"
> },
> 
> ```

I found `index.query.bool.max_clause_count` needs to be tweaked.

Is there a way to tweak value without restarting elasticsearch?

Please advise.

---

<div class="post-metadata">

**Author:** ![Igor\_Motov](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/igor_motov/32/45193_2.png) [@Igor\_Motov](https://discuss.elastic.co/u/Igor_Motov)\
**Post date:** [May 17, 2019, 9:24pm UTC](https://discuss.elastic.co/t/too-many-clauses-maxclausecount-is-set-to-1024-index-query-bool-max-clause-count/181443/2 "2019-05-17T21:24:32Z")

</div>

Which version of elasticsearch are you using?

---

<div class="post-metadata">

**Author:** ![alexus](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/alexus/32/12696_2.png) [@alexus](https://discuss.elastic.co/u/alexus)\
**Post date:** [May 17, 2019, 9:25pm UTC](https://discuss.elastic.co/t/too-many-clauses-maxclausecount-is-set-to-1024-index-query-bool-max-clause-count/181443/3 "2019-05-17T21:25:24Z")

</div>

6.7.2

---

<div class="post-metadata">

**Author:** ![Igor\_Motov](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/igor_motov/32/45193_2.png) [@Igor\_Motov](https://discuss.elastic.co/u/Igor_Motov)\
**Post date:** [May 17, 2019, 9:30pm UTC](https://discuss.elastic.co/t/too-many-clauses-maxclausecount-is-set-to-1024-index-query-bool-max-clause-count/181443/4 "2019-05-17T21:30:15Z")

</div>

In this case you should use `indices.query.bool.max_clause_count` instead. This setting is not dynamic and you should be very careful in using it. This limit there for the reason and you should try to tweak your query first instead of tweaking the query. For more information see [https://www.elastic.co/guide/en/elasticsearch/reference/6.7/search-settings.html](https://www.elastic.co/guide/en/elasticsearch/reference/6.7/search-settings.html)

---

<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:** [June 14, 2019, 9:30pm UTC](https://discuss.elastic.co/t/too-many-clauses-maxclausecount-is-set-to-1024-index-query-bool-max-clause-count/181443/5 "2019-06-14T21:30:16Z")

</div>

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