# How to increase max\_clause\_count in Elasticsearch 8.0.1 without using deprecated settings?

**URL:** <https://discuss.elastic.co/t/how-to-increase-max-clause-count-in-elasticsearch-8-0-1-without-using-deprecated-settings/370721>\
**Category:** Elasticsearch\
**Created:** [November 18, 2024, 9:45pm UTC](https://discuss.elastic.co/t/how-to-increase-max-clause-count-in-elasticsearch-8-0-1-without-using-deprecated-settings/370721 "2024-11-18T21:45:10Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sahil\_Kapoor](https://avatars.discourse-cdn.com/v4/letter/s/5e9695/32.png) [@Sahil\_Kapoor](https://discuss.elastic.co/u/Sahil_Kapoor)\
**Post date:** [November 18, 2024, 9:45pm UTC](https://discuss.elastic.co/t/how-to-increase-max-clause-count-in-elasticsearch-8-0-1-without-using-deprecated-settings/370721/1 "2024-11-18T21:45:10Z")

</div>

I recently upgraded Elasticsearch from version 7.5.1 to 8.0.1, and I encountered an issue with my queries that require around 20k boolean clauses. In Elasticsearch 7, I manually updated the persistent settings to increase the max\_bool\_clause\_count value to allow for this. However, I noticed that in version 8.0.1, the max\_clause\_count setting has been deprecated.

I tried updating the max\_clause\_count, but it didn't reflect as its deprecated. Is there a recommended way to achieve the same result in Elasticsearch 8.0.1 without relying on deprecated settings? Can I configure this limit using any other method or is there an alternative approach to handling large boolean queries?

Here's the error that i am receiving:

```auto
{
  "took": 1817,
  "timed_out": false,
  "_shards": {
    "total": 380,
    "successful": 254,
    "skipped": 254,
    "failed": 126,
    "failures": [
      {
        "shard": 0,
        "index": "some-index-1",
        "node": "sN_kzKnZQ2S_z7SG9CeYBQ",
        "reason": {
          "type": "too_many_nested_clauses",
          "reason": "too_many_nested_clauses: Query contains too many nested clauses; maxClauseCount is set to 1024"
        }
      },
      {
        "shard": 8,
        "index": "some-index-2",
        "node": "dockY6h0Q0GO8oCNOB1LNA",
        "reason": {
          "type": "runtime_exception",
          "reason": "runtime_exception: [field.symbol:/00.{0,5}/] exceeds maxClauseCount [Boolean maxClauseCount is set to 1024]"
        }
      }
    ]
  },
  "hits": {
    "total": { "value": 0, "relation": "eq" },
    "max_score": 0.0,
    "hits": []
  }
}

```
