Elasticsearch批量数据插入

时间:2014-11-20 10:27:46

标签: json elasticsearch

在我的节点应用中,我使用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}

1 个答案:

答案 0 :(得分:4)

\n之后和"SSScore" :null,之前删除"location":"80.102134,12.897401"