# TooManyClauses\[maxClauseCount is set to 1024\]

**URL:** <https://discuss.elastic.co/t/toomanyclauses-maxclausecount-is-set-to-1024/3528>\
**Category:** Elasticsearch\
**Created:** [November 5, 2010, 10:02pm UTC](https://discuss.elastic.co/t/toomanyclauses-maxclausecount-is-set-to-1024/3528 "2010-11-05T22:02:44Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ppearcy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ppearcy/32/980_2.png) [@ppearcy](https://discuss.elastic.co/u/ppearcy)\
**Post date:** [November 5, 2010, 10:02pm UTC](https://discuss.elastic.co/t/toomanyclauses-maxclausecount-is-set-to-1024/3528/1 "2010-11-05T22:02:44Z")

</div>

Hey,  
Running a freakishly large query that is bounded by the number of  
companies someone is watching or has holdings in and am hitting this  
error:  
TooManyClauses[maxClauseCount is set to 1024]

Is there any setting exposed to override this?

Thanks,  
Paul

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [November 5, 2010, 11:00pm UTC](https://discuss.elastic.co/t/toomanyclauses-maxclausecount-is-set-to-1024/3528/2 "2010-11-05T23:00:26Z")

</div>

There isn't one currently, but added it just now to master:  
[Query DSL: Allow to control (globally) the max clause count for `bool` query (defaults to 1024) · Issue #482 · elastic/elasticsearch · GitHub](https://github.com/elasticsearch/elasticsearch/issues/issue/482). Note, you  
are probably better with a terms filter or an or over term filters in this  
case.

On Sat, Nov 6, 2010 at 12:02 AM, Paul [ppearcy@gmail.com](mailto:ppearcy@gmail.com) wrote:

> Hey,  
> Running a freakishly large query that is bounded by the number of  
> companies someone is watching or has holdings in and am hitting this  
> error:  
> TooManyClauses[maxClauseCount is set to 1024]
> 
> Is there any setting exposed to override this?
> 
> Thanks,  
> Paul

---

<div class="post-metadata">

**Author:** ![ppearcy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ppearcy/32/980_2.png) [@ppearcy](https://discuss.elastic.co/u/ppearcy)\
**Post date:** [November 8, 2010, 9:08pm UTC](https://discuss.elastic.co/t/toomanyclauses-maxclausecount-is-set-to-1024/3528/3 "2010-11-08T21:08:30Z")

</div>

Sweet, many thanks!

On Nov 5, 4:00 pm, Shay Banon [shay.ba...@elasticsearch.com](mailto:shay.ba...@elasticsearch.com) wrote:

> There isn't one currently, but added it just now to master:[Query DSL: Allow to control (globally) the max clause count for `bool` query (defaults to 1024) · Issue #482 · elastic/elasticsearch · GitHub](https://github.com/elasticsearch/elasticsearch/issues/issue/482). Note, you  
> are probably better with a terms filter or an or over term filters in this  
> case.
> 
> On Sat, Nov 6, 2010 at 12:02 AM, Paul [ppea...@gmail.com](mailto:ppea...@gmail.com) wrote:
> 
> > Hey,  
> > Running a freakishly large query that is bounded by the number of  
> > companies someone is watching or has holdings in and am hitting this  
> > error:  
> > TooManyClauses[maxClauseCount is set to 1024]
> 
> > Is there any setting exposed to override this?
> 
> > Thanks,  
> > Paul

---

<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:** [July 6, 2017, 4:16am UTC](https://discuss.elastic.co/t/toomanyclauses-maxclausecount-is-set-to-1024/3528/4 "2017-07-06T04:16:57Z")

</div>


