Mapper_parsing_exception out of range long

Error: TransportError(400, u'mapper_parsing_exception', u'json_parse_exception: Numeric value (25826625147376967617854956785651883234) out of range of long (-9223372036854775808 - 9223372036854775807)\n at [Source:

I am getting this error when I am trying to store JSON to ES. The logic is written for fetching documents from other datasource and parsing document into JSON and storing into ES. Since I don't know what field will return number in advance I can't force mapping at field level. Is there a way to disble number detection at root level in elasticsearch?

The value throwing error is:
"serial": 25826625147376967617854956785651883234

Hey,

you can configure to disable coercion on index level, see https://www.elastic.co/guide/en/elasticsearch/reference/2.4/coerce.html

Also you could set up dynamic mapping so that every field becomes a string field.

--Alex