简体   繁体   中英

Elasticsearch update index template

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!

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.

At least in ElasticSearch 7.15 you could create or update an index template using the same endpoint, also:

Index templates are applied during data stream or index creation

It is ovious but "old" data needs to be updated in some way.

In case you are using Logstash, just restart it to do the reindex.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM