3

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

Eric Uldall
  • 2,282
  • 1
  • 17
  • 30
  • http://www.elasticsearch.org/guide/en/elasticsearch/guide/current/reindex.html – Andrei Stefan Dec 05 '14 at 20:55
  • 1
    See also http://www.elastic.co/guide/en/elasticsearch/guide/current/dynamic-mapping.html. – Eric Walker Apr 11 '15 at 19:27
  • 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 Apr 13 '15 at 18:44
  • 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 Apr 13 '15 at 18:45
  • @EricUldall Updating queries can be avoided by using Index Aliases: https://www.elastic.co/guide/en/elasticsearch/guide/current/index-aliases.html – Martijn Heemels Feb 11 '16 at 19:15
  • Yes. That looks like the most desirable solution I've seen thus far. Thanks for the info, @MartijnHeemels – Eric Uldall Feb 23 '16 at 20:31

1 Answers1

1

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

Christoph Wurm
  • 1,072
  • 1
  • 14
  • 31