# Elasticsearch 6.x too\_many\_clauses error

**URL:** <https://discuss.elastic.co/t/elasticsearch-6-x-too-many-clauses-error/115017>\
**Category:** Elasticsearch\
**Created:** [January 11, 2018, 6:32am UTC](https://discuss.elastic.co/t/elasticsearch-6-x-too-many-clauses-error/115017 "2018-01-11T06:32:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jatinseth2007](https://avatars.discourse-cdn.com/v4/letter/j/b19c9b/32.png) [@jatinseth2007](https://discuss.elastic.co/u/jatinseth2007)\
**Post date:** [January 11, 2018, 6:32am UTC](https://discuss.elastic.co/t/elasticsearch-6-x-too-many-clauses-error/115017/1 "2018-01-11T06:32:34Z")

</div>

I am running a elastic search query which is attached via image with this topic, It's giving me too\_many\_clauses error, My question is would I have to increase the limit for maxClauseCount or am I doing anything wrong in query which can be improved ?

 ![screenshot--2018-01-11-11-59-39](https://us1.discourse-cdn.com/elastic/original/3X/f/e/feb2d14b06c3535f5c7d5b28b0eef2b3c3d1c93b.png)

---

<div class="post-metadata">

**Author:** ![Abhilash\_Bolla](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/abhilash_bolla/32/26840_2.png) [@Abhilash\_Bolla](https://discuss.elastic.co/u/Abhilash_Bolla)\
**Post date:** [January 11, 2018, 12:06pm UTC](https://discuss.elastic.co/t/elasticsearch-6-x-too-many-clauses-error/115017/2 "2018-01-11T12:06:37Z")

</div>

Elasticsearch can at a time process only 1024 clauses. Each element in the terms array corresponds to 1 clause. Either you may increase the max clause count parameter in the elasticsearch.yml or you make sure that the length of the terms array doesn't exceed 1024.

---

<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:** [February 8, 2018, 12:06pm UTC](https://discuss.elastic.co/t/elasticsearch-6-x-too-many-clauses-error/115017/3 "2018-02-08T12:06:50Z")

</div>

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