相关疑难解决方法(0)

批量请求在elasticsearch 6.1.1中抛出错误

我最近升级到elasticsearch版本6.1.1,现在我无法批量索引json文件中的文档.我内联它,它工作正常.以下是该文件的内容:

{"index" : {}}
{"name": "Carlson Barnes", "age": 34}
{"index":{}}
{"name": "Sheppard Stein","age": 39}
{"index":{}}
{"name": "Nixon Singleton","age": 36}
{"index":{}}
{"name": "Sharron Sosa","age": 33}
{"index":{}}
{"name": "Kendra Cabrera","age": 24}
{"index":{}}
{"name": "Young Robinson","age": 20}
Run Code Online (Sandbox Code Playgroud)

当我运行此命令时,

curl -XPUT 'localhost:9200/subscribers/ppl/_bulk?pretty' -H 'Content-Type: application/json' -d @customers_full.json
Run Code Online (Sandbox Code Playgroud)

我收到此错误:

"error" : {
    "root_cause" : [
      {
        "type" : "illegal_argument_exception",
        "reason" : "The bulk request must be terminated by a newline [\n]"
      }
    ],
    "type" : "illegal_argument_exception",
    "reason" : "The bulk request must be terminated by …
Run Code Online (Sandbox Code Playgroud)

json bulk-load elasticsearch elasticsearch-5

13
推荐指数
5
解决办法
1万
查看次数

标签 统计

bulk-load ×1

elasticsearch ×1

elasticsearch-5 ×1

json ×1