# Index aliases vs index templates, what to use?

**URL:** <https://discuss.elastic.co/t/index-aliases-vs-index-templates-what-to-use/363923>\
**Category:** Elasticsearch\
**Created:** [July 28, 2024, 10:53am UTC](https://discuss.elastic.co/t/index-aliases-vs-index-templates-what-to-use/363923 "2024-07-28T10:53:03Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Carl\_jo](https://avatars.discourse-cdn.com/v4/letter/c/bc8723/32.png) [@Carl\_jo](https://discuss.elastic.co/u/Carl_jo)\
**Post date:** [July 28, 2024, 10:53am UTC](https://discuss.elastic.co/t/index-aliases-vs-index-templates-what-to-use/363923/1 "2024-07-28T10:53:03Z")

</div>

Can anybody tell me the difference between index aliases and index templates. When to use each one, and what are their main advantages? Will it work for [an9 whatsapp](https://anwtapk.com/an-whatsapp9-download-apk/)?

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [July 28, 2024, 11:37am UTC](https://discuss.elastic.co/t/index-aliases-vs-index-templates-what-to-use/363923/2 "2024-07-28T11:37:42Z")

</div>

An alias is like a virtual index. It points to one or more concrete indices. And you should always use it as it will help you in case you need to reindex your data using another mapping with no service interruption.

When you create an index you can manually provide mapping and settings for it.  
If you have an index template, when you create the index, it will apply the mapping and settings when you create the index.  
Index templates are super useful when you are creating a lot of similar indices. Like time based indices.

---

<div class="post-metadata">

**Author:** ![Rios](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rios/32/95745_2.png) [@Rios](https://discuss.elastic.co/u/Rios)\
**Post date:** [July 28, 2024, 12:27pm UTC](https://discuss.elastic.co/t/index-aliases-vs-index-templates-what-to-use/363923/3 "2024-07-28T12:27:11Z")

</div>

+Few more words:

An alias is related to the naming one or more indices. Useful for group of indices with similar names: index\_YYYYMMDD or index\_0001, index\_002... You can easily search across multiple indices. The alias doesn't care much what is inside index, I mean the structure. You can use "filter" to set limit which document will accessible.

An template is related how will an index look like. It defines:

- index settings: _number\_of\_shards_, _number\_of\_replicas_, ...
- (field) mappings, which defines fields types: will be string/text, number, ip, boolean, or geo\_point or ...

The template can also have alias.

There is more features, however this is enough to have a big picture.
