Elasticsearch update index template

17,807

The template is only used at index creation. You'll have to modify your mapping or recreate your index and reindex your data.

You can use the PUT mapping API to modify your mapping.

Share:
17,807
kenticny
Author by

kenticny

Javascript Coder~

Updated on June 13, 2022

Comments

  • kenticny
    kenticny almost 2 years

    I have a question about elasticsearch index template, there is a scene of my question.

    Create a template for a series indices, named templateA, and there are some indices create from this template, named Index-yyyy.mm.dd2 and Index-yyyy.mm.dd2. After a period of time, I need create some new fields in indice, and I update the templateA.

    SO, How to make the previously created indices use the new template? please give me some suggestion. Thanks a lot!

  • kenticny
    kenticny almost 8 years
    This answer is not very match my problem, but I didn't find a better answer! Thanks for the same.
  • Newerth
    Newerth over 7 years
    Just to clarify - even the template used to create the index can be updated, but you need to use the PUT mapping API (which is index related) instead of PUT index template API.