【发布时间】:2016-08-11 12:09:35
【问题描述】:
我有以下JSON file
我已经使用 awk 去除空格、尾随、下一行
awk -v ORS= -v OFS= '{$1=$1}1' data.json
我在 data.json 的顶部添加了一个创建请求,然后是 \n 和我的其余数据。
{"create": {"_index":"socteam", "_type":"products"}}
当我发出批量提交请求时,我收到以下错误
CURL -XPUT http://localhost:9200/_bulk
{
"took": 1,
"errors": true,
"items": [
{
"create": {
"_index": "socteam",
"_type": "products",
"_id": "AVQuGPff-1Y7OIPIJaLX",
"status": 400,
"error": {
"type": "mapper_parsing_exception",
"reason": "failed to parse",
"caused_by": {
"type": "not_x_content_exception",
"reason": "Compressor detection can only be called on some xcontent bytes or compressed xcontent bytes"
}
}
}
}
]
知道这个错误是什么意思吗?我没有创建任何映射,我正在使用 vanilla elasticsearch
【问题讨论】:
-
我只有一个 JSON 文件,这意味着我必须分解它吗?
-
_bulk调用需要使用 POST。你能显示你正在使用的完整 curl 命令吗?您没有显示您的-d或--data-binary参数。
标签: json search elasticsearch bulkinsert