Inplace Mapping Update for Index

Hi Team,

Wanted to understand, if there is any specific reason why Elasticsearch doesn't allow updating mapping of index in place for existing fields?
Is this anti pattern? Or Is there any particular reason? Wasn't able to find anything regarding the same.

Hi @Aditya_Teltia

In general You can add mappings to an index but you can not remove or update existing mappings as this would break the ability to access the underlying data as the data is stored with the correct mapping / type / definition as it is indexed / stored.

You can create a new index with the new mapping and then _reindex if you want.

Lucene writes immutable files which means that updating anything would break that concept.

1 Like