简体   繁体   中英

elastic search exception on bulk create

I want to test the bulk insert

this is my request

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

I am getting this error:

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
}

I don't know why the error message states to close } i guess this is a correct JSON and i am adding the end of line as the official website asks for

That is the wrong sytax should not have parenthesis after -d it should be as follows:

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM