Olamide OLAJIDE
2 min readFeb 26, 2020

How to update Elasticsearch by modifying the elasticsearch.yml ​ file

If you’re looking to make changes to your cloud elasticsearch.yml file in a cloud deployment, see Add Elasticsearch user settings for the steps to follow to achieve this. The changes you’re able to make in a cloud deployment is however limited, you can see link above for the full list of settings you’re allowed to make on yourelasticsearch.yml ​ cloud deployment. In the event that the setting you want to change is not one of those that a user is allowed to change, create a support case and inquire from Elastic support if this setting can be changed for you. A typical example is indices.query.bool.max_clause_count.

On the other hand, if you’re looking to make changes to your local Elasticsearch cluster, you can make the change directly in your elasticsearch.yml file located at "elasticsearch-x.x.x/config/elasticsearc.yml" by simply adding a line of the required setting to the file. For example, if you want to change indices.query.bool.max_clause_count from it's default value of 1024 to 4096, you can add the line indices.query.bool.max_clause_count: 4096 to your elasticsearch.yml ​file.

Remember that indices.query.bool.max_clause_count is 1024 be default, though the elasticsearch.yml does NOT explicitly contain a line stating this value, yet it would resort to 1024 being the default value. So the only way to change this value is that you will explicitly add the line indices.query.bool.max_clause_count: 4096. By including this line and specifying your preferred value in your own local elasticsearch.yml file, you have ultimately modified the value of "indices.query.bool.max_clause_count" for your cluster.

The following image shows how this line was appended to a sample elasticsearch.yml file:

See sample image showing the syntax to to modify indices.query.bool.max_clause_count

After adding this line and saving the changes to your elasticsearch.yml file, restart Elasticsearch. You can verify your setting by running the command: GET /_cluster/settings/?include_defaults in Kibana or curl -XGET "http://localhost:9200/_cluster/settings/?include_defaults" in the command line on your localhost. Then, look for max_clause_count in the command's output to verify that the value of indices.query.bool.max_clause_count has been set accordingly. See the image below showing the new value of indices.query.bool.max_clause_count

I hope you find this helpful.