Skip to content

Commit c8b8520

Browse files
[docs] Update search-settings documentation to reflect the fact that the indices.query.bool.max_clause_count setting has been deprecated (elastic#91811)
* Update search-settings documentation to reflect the fact that the indices.query.bool.max_clause_count setting has been deprecated * Fix indentation * Replace Elasticsearch with {es} * Add deprecation entry to release notes Co-authored-by: Abdon Pijpelink <[email protected]>
1 parent 29ca2fc commit c8b8520

File tree

2 files changed

+19
-15
lines changed

2 files changed

+19
-15
lines changed

docs/reference/modules/indices/search-settings.asciidoc

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,24 @@ limits.
66

77
[[indices-query-bool-max-clause-count]]
88
`indices.query.bool.max_clause_count`::
9+
deprecated:[8.0.0]
910
(<<static-cluster-setting,Static>>, integer)
10-
Maximum number of clauses a query can contain. Defaults to `4096`.
11+
This deprecated setting has no effect.
1112
+
12-
This setting limits the total number of clauses that a query tree can have. The default of 4096
13-
is quite high and should normally be sufficient. This limit applies to the rewritten query, so
14-
not only `bool` queries can contribute high numbers of clauses, but also all queries that rewrite
15-
to `bool` queries internally such as `fuzzy` queries. The limit is in place to prevent searches
16-
from becoming too large, and taking up too much CPU and memory. In case you're considering
17-
increasing this setting, make sure you've exhausted all other options to avoid having to do this.
18-
Higher values can lead to performance degradations and memory issues, especially in clusters with
19-
a high load or few resources.
20-
21-
Elasticsearch offers some tools to avoid running into issues with regards to the maximum number of
22-
clauses such as the <<query-dsl-terms-query,`terms`>> query, which allows querying many distinct
23-
values while still counting as a single clause, or the <<index-prefixes,`index_prefixes`>> option
24-
of <<text-field-type,`text`>> fields, which allows executing prefix queries that expand to a high
25-
number of terms as a single term query.
13+
{es} will now dynamically set the maximum number of allowed clauses in a query, using
14+
a heuristic based on the size of the search thread pool and the size of the heap allocated to
15+
the JVM. This limit has a minimum value of 1024 and will in most cases be larger (for example,
16+
a node with 30Gb RAM and 48 CPUs will have a maximum clause count of around 27,000). Larger
17+
heaps lead to higher values, and larger thread pools result in lower values.
18+
+
19+
Queries with many clauses should be avoided whenever possible. If you previously bumped this
20+
setting to accommodate heavy queries, you might need to increase the amount of memory available
21+
to {es}, or to reduce the size of your search thread pool so that more memory is
22+
available to each concurrent search.
23+
+
24+
In previous versions of Lucene you could get around this limit by nesting boolean queries
25+
within each other, but the limit is now based on the total number of leaf queries within the
26+
query as a whole and this workaround will no longer help.
2627

2728
[[search-settings-max-buckets]]
2829
`search.max_buckets`::

docs/reference/release-notes/8.1.0.asciidoc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,9 @@ CRUD::
149149
Cluster Coordination::
150150
* Remove last few mentions of Zen discovery {es-pull}80410[#80410]
151151

152+
Search::
153+
* Deprecate the `indices.query.bool.max_clause_count` node setting {es-pull}81525[#81525] (issue: {es-issue}46433[#46433])
154+
152155
SQL::
153156
* Deprecate `index_include_frozen` request parameter {es-pull}83943[#83943] (issue: {es-issue}81939[#81939])
154157

0 commit comments

Comments
 (0)