批量创建时的弹性搜索异常



我想测试一下大容量插入

这是我的请求

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,我正在添加行尾,因为官方网站要求

这是错误的语法,在-d之后不应该有括号应该如下所示:

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

最新更新