2

我正在尝试按照弹性搜索教程(https://www.elastic.co/guide/en/kibana/current/getting-started.html)使用_bulk api导入accounts.json数据。我正在为此任务使用 google-chrome 的Sense插件。

当我将 url 粘贴到curl -XPOST 'localhost:9200/bank/account/_bulk?pretty' --data-binary @accounts.jsonSense 上,它会转换为POST /bank/account/_bulk?pretty.

这里的解决方案:Kibana: Cant import Shakespeare.json on Sense Web Plugin说,要使用CURL命令。但在 Windows 上,curl 命令无法识别。

curl -XPUT localhost:9200/_bulk --data-binary @shakespeare.json 'curl' is not recognized as an internal or external command, operable program or batch file.

4

2 回答 2

2

尝试这个:

POST /<indexName>/<type>/_bulk

复制文件 accounts.json 的内容

并运行。

于 2016-02-28T03:58:25.333 回答
0

只为得到正确答案:

  1. 在此处下载适用于 Windows 的 curl:https ://curl.haxx.se/download.html

    直接链接到 curl-7.54.1-win64-mingw

  2. 从本地驱动器上某处的存档中解压缩bin文件夹。

  3. 将该文件夹的路径添加到您的 PATH 系统变量中。

  4. 重新启动您的explorer.exe进程或重新启动 Windows。这是为了让 shell 刷新 PATH 的值所必需的。

  5. 在命令行 shell 中,执行以下命令:

    curl -XPOST localhost:9200/{some path here}/_bulk?pretty --data-binary @{file name}
    
于 2017-06-29T12:19:25.697 回答