I've just realized that ES has a
_/_template and a
What are they for?
I was using code:
PutIndexTemplateRequest ngramTemplate = new PutIndexTemplateRequest("ngram-template")
I didn't understand why my
ngram-template didn't appear on
After that, I was looking on
Which is the difference between them?
Welcome to this community
The _template API belongs to the old legacy templates. This was a bit more complex as you can have multiple legacy templates for the same index(e.g. a very general template matching all indices
*, a template for all filebeat indices
filebeat-* and a template for the current filebeat version
filebeat-7.13-*). See here for details.
_index_template API solves this by only applying only the template with the highest priority. In order to be able to reuse specific components there is a separe API
_component_template to create reusable components which can be integrated into an index template. See here for details.
This difference is also reflected in Kibana where the top list of the index templates are the newer templates and the legacy templates are listed at the bottom of the page.
If you are asking which one to use I would advise to use the newer version as they are easier to manage (in my opinion) and my guess is that the legacy templates will be removed sooner or later. But if you have lots of templates which would migration hard you may keep the old templates (just make sure that your templates do not collide with the default templates created by Elastic
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.