search-settings.asciidoc 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. [[search-settings]]
  2. === Search settings
  3. The following expert settings can be set to manage global search and aggregation
  4. limits.
  5. [[indices-query-bool-max-clause-count]]
  6. `indices.query.bool.max_clause_count`::
  7. (<<static-cluster-setting,Static>>, integer)
  8. Maximum number of clauses a query can contain. Defaults to `4096`.
  9. +
  10. This setting limits the total number of clauses that a query tree can have. The default of 4096
  11. is quite high and should normally be sufficient. This limit applies to the rewritten query, so
  12. not only `bool` queries can contribute high numbers of clauses, but also all queries that rewrite
  13. to `bool` queries internally such as `fuzzy` queries. The limit is in place to prevent searches
  14. from becoming too large, and taking up too much CPU and memory. In case you're considering
  15. increasing this setting, make sure you've exhausted all other options to avoid having to do this.
  16. Higher values can lead to performance degradations and memory issues, especially in clusters with
  17. a high load or few resources.
  18. Elasticsearch offers some tools to avoid running into issues with regards to the maximum number of
  19. clauses such as the <<query-dsl-terms-query,`terms`>> query, which allows querying many distinct
  20. values while still counting as a single clause, or the <<index-prefixes,`index_prefixes`>> option
  21. of <<text-field-type,`text`>> fields, which allows executing prefix queries that expand to a high
  22. number of terms as a single term query.
  23. [[search-settings-max-buckets]]
  24. `search.max_buckets`::
  25. (<<cluster-update-settings,Dynamic>>, integer)
  26. Maximum number of <<search-aggregations-bucket,aggregation buckets>> allowed in
  27. a single response. Defaults to 65,536.
  28. +
  29. Requests that attempt to return more than this limit will return an error.
  30. [[indices-query-bool-max-nested-depth]]
  31. `indices.query.bool.max_nested_depth`::
  32. (<<static-cluster-setting,Static>>, integer) Maximum nested depth of bool queries. Defaults to `20`.
  33. +
  34. This setting limits the nesting depth of bool queries. Deep nesting of boolean queries may lead to
  35. stack overflow.