Change type of mapping field without reindex?

Hello,

I was wondering what the best way to change the index mapping is?

Let's say we have an indice that has a field date however this field is of type text. (This field does however have a subfield of .date with type date) We want to change this without needing to reindex all data. So now we want date field to have the type date.

It seems the best way to do this would be to create a new index with the correct mappings and reindex into that index. However is there a way that is simpler, so we do not need to reindex ALL our data?

Kind regards, Chenko

No, you cannot update mapping for the existing fields without re-indexing.

though, why don't you use the current date.date sub-field instead?

also you might think of adding a new field like date_new for example. however, this will also only works for newly indexed documents, not the previously indexed ones.

you might find much similar questions as yours, here and on the Stackoverflow (e.g. below one)