Tag Archives: mapper_parsing_exception

Elasticsearch error mapper_ parsing_ exception

Geeks, please accept the hero post of 2021 Microsoft x Intel hacking contest>>>

Recently, when using Java API to store es, the following error was reported:

{“took”:150,”errors”:true,”items”:[{“index”:{“_ index”:”test”,”_ type”:”type1″,”_ id”:”794719072″,”status”:400,”error”:{“type”:”mapper_ parsing_ exception”,”reason”:”failed to parse”,”caused_ by”:{“type”:”not_ x_ content_ exception”,”reason”:”Compressor detection can only be called on some xcontent bytes or compressed xcontent bytes”}}}}

After investigation, it is found that during the warehousing process, Java wrongly put the string 1 (“1”) into the warehouse, that is, the data in the following format is put into the warehouse:

{"index":{"_index":"test","_type":"type1"}}
"1"

The above error will be reported. The format of the input data is wrong and mapping cannot parse it