当我转储json时,将json发送到弹性搜索时出错

2024-09-30 08:18:17 发布

您现在位置:Python中文网/ 问答频道 /正文

我通过将josn发送到elastic search将数据上载到elastic search服务器,它工作正常,但在一些字符上,例如\it gives error,当我在json中发送反斜杠时,&;如果我转储响应的json,它将给出error

"{"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}"

我的弦是

"{

"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"
}
"

Tags: tonamejsonsearchbytesparsetypeexception

热门问题