I am trying to implement some kind of migration for mapping changes. So my problem is I want to use reindex if for some reason my new mapping doesn't work with my current data (e.g. types changed). If a field has been removed I do the following:
- create a new index with the new mapping (where the removed field is not included)
- reindex my current index in the newly created index
- delete old index and set alias to new index
The dynamic mapping for this type is set to false so I thought the removed field will just be ignored when the data is reindexed into the new index with the new mapping. So my problem is the field just gets copied into the new index although there is no mapping defined for this one. As described in the documentation (https://www.elastic.co/guide/en/elasticsearch/reference/5.2/dynamic.html) I thought the field without any mapping would be ignored.
On the other hand a dynamic mapping set to strict would fail. Why is dynamic strict handled but dynamic false is just ignored?
Am I missing something or is there a better way to do this?
Thanks in advance