Retrieve the configured max_clause_count setting 8.x

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.

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:

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

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

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?

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?

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

What is your use case for checking it?

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.