在我的节点应用程序中,我使用 Elasticsearch 作为我的后端进程。我试图从 json 文件插入数据,但出现错误。
我的json:
{"index":{"_index":"mfissample", "_type":"place_mfi", "_id": "1"}}
{"PAR" : 42.31,"Center":"xx","District":"yy","Country" : "vv","GLP" : 13073826.63,"State" : "zz","SSScore" :null, "location":"80.102134,12.897401"}
{"index":{"_index":"mfissample", "_type":"place_mfi", "_id": "2"}}
{"PAR" : 42.31,"Center" : "xx","District" : "yy","Country" : "zz","GLP" : 13073826.63,"State" : "vv","SSScore" :null,
"location":"80.102134,12.897401"}
我的命令:
curl -XPOST 'http://localhost:9200/_bulk' --data-binary @jsonbulk.json
错误:
{"error":"JsonParseException[Unexpected character (':' (code 58)): expected a valid value (number, String, array, object, 'true', 'false' or 'null')\n at [Source: [B@792c4b55; line: 1, column: 12]]","status":500}
最佳答案
删除\n
之后"SSScore" :null,
在 "location":"80.102134,12.897401"
之前.
关于json - Elasticsearch批量数据插入,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27037220/