3
votes

I am currently using the config templates to store mappings for my indexes in ES and was wondering... If I updated my mapping in a template file, how would I go about propagating that mapping to already indexed documents? Is there currently a way to reindex the entire index or index type??

Any help is much appreciated!

E

1
So, from the comment from @AndreiStefan my take away is you can't reindex documents in place. I would have to create an entirely new index, similar to a mysql SELECT INTO. This is a bit unconventional as it would require any queries referencing a specific index to be changed.Eric Uldall
As far as dynamic mappings go, this is a cool feature, although it doesn't really help with this issue as I may want a property to be analyzed today and not analyzed tomorrow. I also use a very strict data mapping to import into ES so there's never an issue of fields that may or may not be there.Eric Uldall
@EricUldall Updating queries can be avoided by using Index Aliases: elastic.co/guide/en/elasticsearch/guide/current/…Martijn Heemels

1 Answers

1
votes

Since 2.3 Elasticsearch has a Reindex API that allows indexing into a target index with a different mapping.

Documentation: https://www.elastic.co/guide/en/elasticsearch/reference/5.0/docs-reindex.html