Update mappings on fly


(Theo) #1

We have experienced recently an issue when we released to production because our ES mappings needed to update.

What's the normal process to update the mappings on fly (with zero downtime) on production?
I'd like to see what most of the people do in those cases.


(Bernt Rostad) #2

It depends on whether you need to change the mapping for historical data or just for future data.

For future data (stored in new indices) it's sufficient just to put the new Index mapping in the cluster.

If you need a new mapping also for the historical data you will have to reindex the old data into new indices to get the new mapping. If you use Index Aliases, this is easy to do in production because users can then continue to query the old indices (through their aliases) until the new one is ready, then you just swap the alias and delete the old index. Just make sure to have enough disc space for the reindexing.


(Theo) #3

Thanks for the reply, @Bernt_Rostad!

In our specific usecase we wanted to set the type of a field from text to datetime, so we wanted to change it for historical data.

From what I can foresee most of the times we'll need to just update field types or add new fields, if that helps?


(system) #4

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.