# Retrieve the configured max\_clause\_count setting 8.x

**URL:** <https://discuss.elastic.co/t/retrieve-the-configured-max-clause-count-setting-8-x/359873>\
**Category:** Elasticsearch\
**Tags:** runtime-fields\
**Created:** [May 21, 2024, 3:01am UTC](https://discuss.elastic.co/t/retrieve-the-configured-max-clause-count-setting-8-x/359873 "2024-05-21T03:01:13Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![mengjiann](https://avatars.discourse-cdn.com/v4/letter/m/6de8d8/32.png) [@mengjiann](https://discuss.elastic.co/u/mengjiann)\
**Post date:** [May 21, 2024, 3:01am UTC](https://discuss.elastic.co/t/retrieve-the-configured-max-clause-count-setting-8-x/359873/1 "2024-05-21T03:01:13Z")

</div>

Hi,

I understand that `indices.query.bool.max_clause_count` is deprecated in 8.x. The calculation is performed dynamically depending on the heap size and also the thread pool.

> <https://github.com/elastic/elasticsearch/blob/93fdfe5ae4d20c2aac56a5da0638aa207894a245/server/src/main/java/org/elasticsearch/search/SearchUtils.java#L18>

But is there is a way to retrieve it during runtime? I noticed there is setting returned from: curl localhost:9200/\_nodes/settings. But, the value is always 6000 for the response from the endpoint:

```auto
"indices" : {
          "query" : {
            "bool" : {
              "max_clause_count" : "6000"
            }
          }
        },

```

---

<div class="post-metadata">

**Author:** ![mengjiann](https://avatars.discourse-cdn.com/v4/letter/m/6de8d8/32.png) [@mengjiann](https://discuss.elastic.co/u/mengjiann)\
**Post date:** [May 21, 2024, 8:11am UTC](https://discuss.elastic.co/t/retrieve-the-configured-max-clause-count-setting-8-x/359873/2 "2024-05-21T08:11:10Z")

</div>

It seems like the following result is obtained from **\_nodes/settings** is because that the deprecated setting is configured in elasticsearch.yml file:

indices.query.bool.max\_clause\_count: 6000.

Removing the config will result in no config(max\_clause\_count) response for **\_nodes/settings**

---

<div class="post-metadata">

**Author:** ![Carlos\_D](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/carlos_d/32/126245_2.png) [@Carlos\_D](https://discuss.elastic.co/u/Carlos_D)\
**Post date:** [May 22, 2024, 11:16am UTC](https://discuss.elastic.co/t/retrieve-the-configured-max-clause-count-setting-8-x/359873/3 "2024-05-22T11:16:44Z")

</div>

Hi @mengjiann :

The setting is calculated at boot time and it will remain constant for a specific node.

Is there other behaviour that you would expect for this setting?

---

<div class="post-metadata">

**Author:** ![mengjiann](https://avatars.discourse-cdn.com/v4/letter/m/6de8d8/32.png) [@mengjiann](https://discuss.elastic.co/u/mengjiann)\
**Post date:** [May 25, 2024, 5:20am UTC](https://discuss.elastic.co/t/retrieve-the-configured-max-clause-count-setting-8-x/359873/4 "2024-05-25T05:20:44Z")

</div>

Hi Carlos,

Thanks for the reply. Yes, I'm aware that its calculated at boot time and remain constant after that. But, I'm looking for a way to retrieve the configured value after its boot up, eg. through the endpoint that I mentioned above (\_nodes/settings) to get the value during runtime.

Is there any ways now?

---

<div class="post-metadata">

**Author:** ![Carlos\_D](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/carlos_d/32/126245_2.png) [@Carlos\_D](https://discuss.elastic.co/u/Carlos_D)\
**Post date:** [May 29, 2024, 11:54am UTC](https://discuss.elastic.co/t/retrieve-the-configured-max-clause-count-setting-8-x/359873/5 "2024-05-29T11:54:04Z")

</div>

Got it - I don't believe there's a way to get this value at runtime.

What is your use case for checking it?

---

<div class="post-metadata">

**Author:** ![mengjiann](https://avatars.discourse-cdn.com/v4/letter/m/6de8d8/32.png) [@mengjiann](https://discuss.elastic.co/u/mengjiann)\
**Post date:** [June 1, 2024, 3:16am UTC](https://discuss.elastic.co/t/retrieve-the-configured-max-clause-count-setting-8-x/359873/6 "2024-06-01T03:16:25Z")

</div>

Noted. Is there plan to support the retrieval in the future?

Our web application allows users to add fields to be searched within the same index. There are some users who have added quite a number of fields and it results in the exceeding the max\_clause\_count error during the search on all the fields.

From the official documentation, the only way is to increase allocated memory so that the max\_clause\_count could be increased during runtime. Without knowing the calculated value during runtime, the allocation is done based on trial and error. Thus, knowing the runtime value would help us in the whole process.

The alternative could also be a redesign on our existing implementation for our web app.

Thanks again for checking.
