gpt4 book ai didi

json - Elasticsearch批量数据插入

转载 作者:行者123 更新时间:2023-12-02 22:17:25 24 4
gpt4 key购买 nike

在我的节点应用程序中,我正在使用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/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com