ES Template versioning


(oxygen300) #1

Hi Team,

I have a question about the use case of version field in the index templates.

https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-templates.html#versioning-templates

I have observed that I can put any version number, doesn't have to follow any pattern.
As the doc also mentions, if we don't provide version while updating the template, the version is deleted.

So, my questions:

  1. What is the exact use case for version?
  2. Is there any way to retrieve a template by version number?

Thanks in advance!


(Mark Walkom) #2

Per the docs;

The version field is completely optional and it is meant solely for external management of templates.

So it'd be useful if you had all your code in a repo and wanted to use that value as another indicator of what has been deployed.

It doesn't store all the versions, just the latest.