2017-02-10 48 views
0

我通过发送josn到弹性搜索将数据上传到弹性搜索服务器,它工作正常,但在某些字符上出现错误,如发送反斜杠在JSON,&如果我倾倒响应的JSON提示错误发送json到弹性搜索时发生错误,当我转储json的错误

"{"error": {"caused_by": {"reason": "Compressor detection can only be called on some xcontent bytes or compressed xcontent bytes", "type": "not_x_content_exception"}, "reason": "failed to parse", "root_cause": [{"reason": "failed to parse", "type": "mapper_parsing_exception"}], "type": "mapper_parsing_exception"}, "status": 400}" 

我josn串,

"{ 

"first_name":"muhammad irfan", 

"middle_name": "", 

"last_name":"ulhaq choudhary", 

"address":"H,no,197,St,no. 157. G-9\\4", 

"city":"Islamabad", 

"phone_number1":"", 

"phone_number2":"", 

"phone_number3":"", 

"gender":"M", 

"updation_time":"0000-01-01", 

"country_id":"1" 
} 
" 
+0

检查此:https://github.com/elastic/elasticsearch/pull/21440 – MYGz

+0

您的json是有效的,看起来像Elasticsearch的错误。你使用的是什么弹性搜索版本? –

回答

0

我不知道你用哪个包。 但您可以尝试\\\\而不是\\

+0

我已经尝试\\\\但错误仍然相同 –