Elasticsearch – 在Windows中使用Sense Web Plugin进行批量插入

我试图根据弹性search教程( https://www.elastic.co/guide/en/kibana/current/getting-started.html )使用_bulk api导入accounts.json数据。 我正在使用谷歌浏览器的Sense插件来完成这个任务。

当我粘贴URL- curl -XPOST 'localhost:9200/bank/account/_bulk?pretty' --data-binary @accounts.json Sense时 ,它转换为POST /bank/account/_bulk?pretty

这里的解决scheme: Kibana:无法导入Sense Web Plugin上的Shakespeare.json ,使用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.

尝试这个:

 POST /<indexName>/<type>/_bulk 

复制文件accounts.json的内容

并运行。

只要有正确的答案:

  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}