# Change type of mapping field without reindex?

**URL:** <https://discuss.elastic.co/t/change-type-of-mapping-field-without-reindex/360299>\
**Category:** Elasticsearch\
**Tags:** painless, reindex\
**Created:** [May 27, 2024, 1:36pm UTC](https://discuss.elastic.co/t/change-type-of-mapping-field-without-reindex/360299 "2024-05-27T13:36:18Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Chenko](https://avatars.discourse-cdn.com/v4/letter/c/258eb7/32.png) [@Chenko](https://discuss.elastic.co/u/Chenko)\
**Post date:** [May 27, 2024, 1:36pm UTC](https://discuss.elastic.co/t/change-type-of-mapping-field-without-reindex/360299/1 "2024-05-27T13:36:18Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Sajad\_Soltanian](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sajad_soltanian/32/122022_2.png) [@Sajad\_Soltanian](https://discuss.elastic.co/u/Sajad_Soltanian)\
**Post date:** [May 27, 2024, 11:02pm UTC](https://discuss.elastic.co/t/change-type-of-mapping-field-without-reindex/360299/2 "2024-05-27T23:02:26Z")

</div>

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](https://discuss.elastic.co/t/updating-a-mapping-in-existing-indicese/294918/7))

> [@Updating a mapping in existing indicese](https://discuss.elastic.co/t/updating-a-mapping-in-existing-indicese/294918/7):
>
> it is impossible to change existing fields mappings or delete existing fields.
