I am using Elasticsearch version 7.16.2. Have set up the search on the domain-specific data around 20k records. When I am searching for a particular query, I am getting the below error.
RequestError(400, 'search_phase_execution_exception', 'failed to create query: maxClauseCount is set to 1024')
I ran the _analyze on that particular query with the analyzer I am using.
The token count is 35.
Apparently you can change the maxClauseCount value but it doesn't seem to be recommended because it affects memory and cpu performance.
This setting limits the number of clauses a Lucene BooleanQuery can have. The default of 1024 is quite high and should normally be sufficient. This limit does not only affect Elasticsearchs bool query, but many other queries are rewritten to Lucene’s BooleanQuery internally. The limit is in place to prevent searches from becoming too large and taking up too much CPU and memory. In case you’re considering increasing this setting, make sure you’ve exhausted all other options to avoid having to do this. Higher values can lead to performance degradations and memory issues, especially in clusters with a high load or few resources.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.