Description
In Lucene 9.0 index searchers will start to check the overall number of clauses in a Query and will throw an error if it is above a certain threshold. The default value is the same than the max boolean clause (1024) but is configurable per index searcher. This is breaking change so only Elasticsearch 8.0 could be affected by this but I am opening this issue to raise awareness and discuss the best options to introduce this change in the next major version. Today we have a setting in Elasticsearch that controls the maximum number of clauses that a single boolean query can handle (indices.query.bool.max_clause_count
) and we use it in different layer as an hard limit (filter aggregations, fuzzy query expansion, ...). Since the checking of the number of clauses is now global to a query one first actionable item would be to change the name of the setting to reflect the new behavior. So instead of indices.query.bool.max_clause_count
it would be indices.query.max_clause_count
. Another point for the discussion is the handling of stored queries (percolator, ...) in Elasticsearch that breaks the new limit, should we accept them if they were created in a version where the limit was per boolean query ?