【问题标题】:elastic search exception on bulk create批量创建时的弹性搜索异常
【发布时间】:2016-01-17 01:47:41
【问题描述】:

我想测试批量插入

这是我的要求

curl -PUT "http://localhost:9200/blabla/blabla/_bulk?pretty" -d '{
{"create": {}}\n
{"name" : "super"}\n
}' -i

我收到此错误:

HTTP/1.1 500 Internal Server Error
Content-Type: application/json; charset=UTF-8
Content-Length: 210

{
  "error" : "JsonParseException[Unexpected end-of-input: expected close marker for OBJECT (from [Source: [B@29ae00d4; line: 1, column: 0])\n at [Source: [B@29ae00d4; line: 1, column: 3]]",
  "status" : 500
}

我不知道为什么错误消息指出关闭} 我猜这是一个正确的 JSON,我按照官方网站的要求添加了行尾

【问题讨论】:

    标签: macos curl elasticsearch elasticsearch-bulk


    【解决方案1】:

    那是错误的语法,-d 后面不应该有括号 应该是这样的:

     curl -PUT "http://localhost:9200/blabla/blabla/_bulk?pretty" -d '
    {"create": {}}\n
    {"name" : "super"}\n
    ' -i
    

    【讨论】:

      猜你喜欢
      • 2019-06-03
      • 1970-01-01
      • 2022-06-16
      • 2017-04-02
      • 1970-01-01
      • 1970-01-01
      • 2012-08-23
      • 1970-01-01
      • 2018-03-10
      相关资源
      最近更新 更多