Any way to add a suffix to an index name in an index template?

Similar to what's described in Index Aliases and Zero Downtime , we are creating our indices in the form "typeprefix-id-v1" and then accessing them through an alias like "typeprefix-id". We are doing that so we can reindex and then move the alias to a new version w/ little to no downtime.

We would like to use index templates so a missing index is created automatically when our app indexes a new document that doesn't match an existing index. Is there any way to have elasticsearch create the index with the suffix -v1 and add the alias?.

Instead of adding a -v1 suffix to the index when it's created, I'm going to try just creating the index with the base name typeprefix-id. Then when I reindex, I'll create the new index as typeprefix-id-v2, delete the old index and add the base name as an alias to the new index.

I'll have to delete the old index first because an alias can't have the same name as an existing index. Don't think this will work in a 'hot' reindexing scheme where the original index is under load during the reindexing process though. I'd love to see an example of how you are accomplishing that?



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