# Update field type in existing mapping in elastic search

**URL:** <https://discuss.elastic.co/t/update-field-type-in-existing-mapping-in-elastic-search/18244>\
**Category:** Elasticsearch\
**Created:** [June 21, 2014, 4:00am UTC](https://discuss.elastic.co/t/update-field-type-in-existing-mapping-in-elastic-search/18244 "2014-06-21T04:00:29Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![srikanth\_ramineni](https://avatars.discourse-cdn.com/v4/letter/s/aca169/32.png) [@srikanth\_ramineni](https://discuss.elastic.co/u/srikanth_ramineni)\
**Post date:** [June 21, 2014, 4:00am UTC](https://discuss.elastic.co/t/update-field-type-in-existing-mapping-in-elastic-search/18244/1 "2014-06-21T04:00:29Z")

</div>

Hi ,

can you please provide inputs to update the existing field type in the  
mapping.Below is the requirement.

I have crated contractIndex and it is type is conract. In that i have  
fields contractid as long, contract number as long but i want to change  
contract number type as string.

Thanks,  
Srikanth.

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/e80c0884-9e18-4af2-8c04-69cde01fd3ab%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/e80c0884-9e18-4af2-8c04-69cde01fd3ab%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [June 21, 2014, 4:49am UTC](https://discuss.elastic.co/t/update-field-type-in-existing-mapping-in-elastic-search/18244/2 "2014-06-21T04:49:13Z")

</div>

You can't.

You basically need to reindex.

That said, you can try to use a multifield which add a String representation of the same field. But old values (old docs) won't have this new field populated.

## HTH

David 😉  
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 21 juin 2014 à 06:00, srikanth ramineni [ri.srikanth@gmail.com](mailto:ri.srikanth@gmail.com) a écrit :

Hi ,

can you please provide inputs to update the existing field type in the mapping.Below is the requirement.

I have crated contractIndex and it is type is conract. In that i have fields contractid as long, contract number as long but i want to change contract number type as string.

Thanks,  
Srikanth.

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/e80c0884-9e18-4af2-8c04-69cde01fd3ab%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/e80c0884-9e18-4af2-8c04-69cde01fd3ab%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/3FB4C99C-F209-4697-A902-3582C21711BF%40pilato.fr](https://groups.google.com/d/msgid/elasticsearch/3FB4C99C-F209-4697-A902-3582C21711BF%40pilato.fr).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 1:20am UTC](https://discuss.elastic.co/t/update-field-type-in-existing-mapping-in-elastic-search/18244/3 "2017-07-06T01:20:47Z")

</div>


