Setting the BooleanQuery maxClauseCount in Elasticsearch

Traackr Developers
Traackr Dev Blog
Published in
1 min readOct 18, 2013

--

Setting the BooleanQuery maxClauseCount in Elasticsearch

If you have come across the TooManyClauses exception while querying Elasticsearch, chances are you are using a terms query, prefix query, fuzzy query, wildcard query orrange query that ends up expanding into more than 1024 boolean clauses.

[…]

if you really need to use a query instead of a filter (e.g. you need your results sorted by relevance), then you can bump the maxClauseCount by setting the following in the Elasticsearch config file:

index.query.bool.max_clause_count: 4096

--

--

Traackr Developers
Traackr Dev Blog

We are a tight-knit group of individuals who genuinely get excited about Mondays.