2016-02-28 113 views
1

我想根据弹性搜索教程(https://www.elastic.co/guide/en/kibana/current/getting-started.html)使用_bulk api导入accounts.json数据。我正在使用google-chrome的Sense插件来完成此任务。Elasticsearch - 在Windows中使用Sense Web Plugin进行批量插入

当我粘贴url curl -XPOST 'localhost:9200/bank/account/_bulk?pretty' --data-binary @accounts.json,其转换为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.

+0

您可以下载卷曲的Windows在https://curl.haxx.se/download.html – Val

+0

@val这也无法正常工作,得到这个错误:'curl -XPOST'localhost:9200/bank/account/_bulk?pretty'--data-binary @ accounts.json' 'curl:(6)Could not resolve host:' localhost'' –

+1

好吧,我明白了,它可以用于:'curl -XPOST localhost:9200/bank/account/_bulk?pretty --data-binary @ accounts.json'。非常感谢:) –

回答

1

试试这个:

POST /<indexName>/<type>/_bulk 

复制文件的内容accounts.json

和运行。

+1

这个过程对于少量的数据是可以的,但是当数据非常大时,复制粘贴不起作用。 –

0

正好有正确答案:

  1. 下载卷曲的Windows这里:https://curl.haxx.se/download.html

    Direct link to 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}