Setting the BooleanQuery maxClauseCount in Elasticsearch
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