# Update field type to solve mapper\_parsing\_exception

**URL:** https://discuss.elastic.co/t/update-field-type-to-solve-mapper-parsing-exception/234815
**Category:** Elasticsearch
**Created:** [May 28, 2020, 8:20pm UTC](https://discuss.elastic.co/t/update-field-type-to-solve-mapper-parsing-exception/234815 "2020-05-28T20:20:11Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![ahmad\_qasim](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ahmad_qasim/32/60470_2.png) [@ahmad\_qasim](https://discuss.elastic.co/u/ahmad_qasim)
#### Post date: [May 28, 2020, 8:20pm UTC](https://discuss.elastic.co/t/update-field-type-to-solve-mapper-parsing-exception/234815/1 "2020-05-28T20:20:11Z")

</div>

Hello,  
field 'status' stored in elasticsearch, based on different responses from vendors(200,0,'XSDDF',...etc), and the value may represent string or integers, the definition of status field in mapping is :  
"status" : {  
"type" : "long"  
},  
so when value is string(like :XDFCCCV), below exception will appear:

`{"type":"mapper_parsing_exception","reason":"failed to parse field [status] of type [long] in document with id 'xxx-xxx-xx-xxx-xxx'","caused_by":{"type":"illegal_argument_exception","reason":"For input string: \"success\""}}`

can i update the mapping for status to accept string or integers, to prevent above exception?

---

<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: [May 29, 2020, 4:40am UTC](https://discuss.elastic.co/t/update-field-type-to-solve-mapper-parsing-exception/234815/2 "2020-05-29T04:40:50Z")

</div>

Welcome!

You can not "update" an existing mapping.  
You need to create a new one and reindex.

---

<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: [June 26, 2020, 4:40am UTC](https://discuss.elastic.co/t/update-field-type-to-solve-mapper-parsing-exception/234815/3 "2020-06-26T04:40:57Z")

</div>

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