【发布时间】:2018-05-30 11:45:16
【问题描述】:
在使用 Elasticsearch 通过 curl 命令加载数据集时->
curl -H "Content-Type: application/x-ndjson" -XPOST "localhost:9200/shakespeare/doc/_bulk?pretty" --data-binary @$shakespeare_6.0
遇到以下警告->
Warning: Couldn't read data from file "$shakespeare_6.0", this makes an empty
Warning: POST.
{
"error" : {
"root_cause" : [
{
"type" : "parse_exception",
"reason" : "request body is required"
}
],
"type" : "parse_exception",
"reason" : "request body is required"
},
"status" : 400
}
我的数据是:
{"index":{"_index":"shakespeare","_id":0}}
{"type":"act","line_id":1,"play_name":"Henry IV", "speech_number":"","line_number":"","speaker":"","text_entry":"ACT I"}
此警告的根本原因是什么?我使用的是 64 位 Windows 10。
另外,请告诉我将数据发送到弹性搜索的不同方式是什么?我是菜鸟。
【问题讨论】:
-
文件
$shakespeare_6.0似乎不存在。你确定文件名正确吗? -
这似乎与以下问题相同:stackoverflow.com/questions/39893964/…
-
@mbuechmann 是的,文件名是正确的。我是从elastic.co/guide/en/kibana/6.x/tutorial-load-dataset.html下载的
-
@markvdlaan93 该文件有读取权限,我也尝试在更改当前目录后运行它,但没有成功。
-
该文件的名称是
shakespeare_6.0.json,而不是$shakespeare_6.0!
标签: elasticsearch