2015-10-18 74 views
0

我要测试的批量插入弹性搜索例外创建

这是我的要求

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: [[email protected]; line: 1, column: 0])\n at [Source: [[email protected]; line: 1, column: 3]]", 
    "status" : 500 
} 

我不知道为什么该错误消息指出关闭}我想这是一个正确的JSON和我加入行末作为官方网站要求

回答

2

这是错误的语法时才不应该有括号后-d 应该如下:

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