# Global index settings

**URL:** <https://discuss.elastic.co/t/global-index-settings/262176>\
**Category:** Elasticsearch\
**Created:** [January 25, 2021, 11:07pm UTC](https://discuss.elastic.co/t/global-index-settings/262176 "2021-01-25T23:07:30Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![cdalexndr](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cdalexndr/32/55274_2.png) [@cdalexndr](https://discuss.elastic.co/u/cdalexndr)\
**Post date:** [January 25, 2021, 11:07pm UTC](https://discuss.elastic.co/t/global-index-settings/262176/1 "2021-01-25T23:07:30Z")

</div>

I want to apply some global index settings (index.number\_of\_replicas, index.codec) to any new created index.

From [Index settings in configuration file does not take effect](https://discuss.elastic.co/t/index-settings-in-configuration-file-does-not-take-effect/113120) I understand that configuraiton of global index settings in elasticsearch.yml has been deprecated and is not supported, so I have to create an index template.

Should I create an "\*" index template that matches all indexes? Is it valid to match all indexes?

What if multiple index templates match the new index (my global index template + other)?  
[Docs](https://www.elastic.co/guide/en/elasticsearch/reference/current/index-templates.html) say: "If a new data stream or index matches more than one index template, the index template with the highest priority is used."  
Then if my global index template is applied, other index template settings are lost....

[Docs](https://www.elastic.co/guide/en/elasticsearch/reference/current/index-templates.html) include info about template components used to create a composite index template.  
The workaround may be to create component templates and modify existing index templates to include my component template that includes my settings.  
This is very tedious, time consuming, and complex (easily buggy) as compared to the previous simple method of defining global index settings in elasticsearch.yml.

The index template seems a bad alternative. They may allow more control over settings but are hard to use.

Additional sources:

> <https://github.com/elastic/elasticsearch/issues/21105>
>
> Validation of index templates has proven difficult to get right due to how multiple templates that might be invalid on their...

  

> <https://github.com/elastic/elasticsearch/issues/53101>
>
> The meta issue will track the development of the second version of index templates.
> Tasks:
> Introduce component templates in cluster state (@dakrone)...

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [February 22, 2021, 11:07pm UTC](https://discuss.elastic.co/t/global-index-settings/262176/2 "2021-02-22T23:07:32Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
