Update field type to solve mapper_parsing_exception

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?

Welcome!

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

1 Like

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