# Is it safe to change field mapping from integer to long without index?

**URL:** <https://discuss.elastic.co/t/is-it-safe-to-change-field-mapping-from-integer-to-long-without-index/158021>\
**Category:** Elasticsearch\
**Created:** [November 23, 2018, 1:48pm UTC](https://discuss.elastic.co/t/is-it-safe-to-change-field-mapping-from-integer-to-long-without-index/158021 "2018-11-23T13:48:14Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![timonwong](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/timonwong/32/12080_2.png) [@timonwong](https://discuss.elastic.co/u/timonwong)\
**Post date:** [November 23, 2018, 1:48pm UTC](https://discuss.elastic.co/t/is-it-safe-to-change-field-mapping-from-integer-to-long-without-index/158021/1 "2018-11-23T13:48:15Z")

</div>

Recently we encountered ES ingestion errors that complains:  
`json_parse_exception: Numeric value (2147557547) out of range of int`

After some digging we found that one of our index field mapping uses "integer" data type, which sadly should be "long".

We know changing a field mapping is dangerous, but is there any chance that changing between "integer" and "long" a safe operation? thanks 😂

---

<div class="post-metadata">

**Author:** ![Magnus\_Kessler](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnus_kessler/32/42001_2.png) [@Magnus\_Kessler](https://discuss.elastic.co/u/Magnus_Kessler)\
**Post date:** [November 23, 2018, 1:53pm UTC](https://discuss.elastic.co/t/is-it-safe-to-change-field-mapping-from-integer-to-long-without-index/158021/2 "2018-11-23T13:53:13Z")

</div>

No, you cannot change `integer` to `long` for a given field without reindexing. The data is stored differently for the two datatypes.

---

<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:** [December 21, 2018, 1:56pm UTC](https://discuss.elastic.co/t/is-it-safe-to-change-field-mapping-from-integer-to-long-without-index/158021/3 "2018-12-21T13:56:19Z")

</div>

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