Elasticsearch update index template

kenticny picture kenticny · Jul 7, 2016 · Viewed 17.6k times · Source

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!

Answer

baudsp picture baudsp · Jul 7, 2016

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.