# Automatically creating index versions and alias

**URL:** <https://discuss.elastic.co/t/automatically-creating-index-versions-and-alias/26819>\
**Category:** Elasticsearch\
**Created:** [August 4, 2015, 5:09pm UTC](https://discuss.elastic.co/t/automatically-creating-index-versions-and-alias/26819 "2015-08-04T17:09:40Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![marcelog](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marcelog/32/413_2.png) [@marcelog](https://discuss.elastic.co/u/marcelog)\
**Post date:** [August 4, 2015, 5:09pm UTC](https://discuss.elastic.co/t/automatically-creating-index-versions-and-alias/26819/1 "2015-08-04T17:09:40Z")

</div>

Hello,

As described here in [Index Aliases and Zero Downtime](https://www.elastic.co/guide/en/elasticsearch/guide/current/index-aliases.html "Index Aliases and Zero Downtime"), we're creating our indices in the form " **thing-2015\_08\_v1**" and then we access them through an alias like " **thing-2015\_08**", so we can later on reindex or have room to apply any needed improvements by just pointing the alias to a different index version.

Currently, we also use index templates so a missing index is created automatically when it doesn't exist. This is working flawlessly.

The question is about what would be the best way to actually have ES create the index with the suffix **\_v1** and at the same time the new alias pointing to it. Using an index template will automagically create **thing-2015\_08** but not **thing\_2015\_08\_v1** (since all our queries use the former and not the latter).

Our "poor man's solution" is a cron job that runs every 28th day of the month to create **thing\_2015\_08\_v1** and setup the alias **thing\_2015\_08** pointing to it, so it is ready for the next month.

So: is there any solution already built in in ES itself for this?

Thanks in advance!

---

<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:** [July 5, 2017, 11:57pm UTC](https://discuss.elastic.co/t/automatically-creating-index-versions-and-alias/26819/2 "2017-07-05T23:57:28Z")

</div>


