ElasticSearch Update Mapping and Reindex
- taolius
- Jul 14, 2016
- 1 min read
1. create an alias to current index
POST /tmp_index/_alias/current_index
2. create a new index with the correct mapping (or updated fields)
POST /new_index
3. reindex current index to new index
POST /_reindex
{ "source": { "index": "current_index" }, "dest": { "index": "new_index" } }
4. switch alias
POST /_aliases { "actions": [ { "remove": { "index": "tmp_index", "alias": "current_index" } }, { "add": { "index": "new_index", "alias": "current" } } ] }
Comentarios