In my project i need to making bulk requests to elasticsearch, that means
making http post requests in program instead of using curl.
I already set content-type to json, and the body is like: '{ "index" :
{"_index":"test","_type":"one","_id":"1"}}\n{"name":"test","id":"1" }\n',
and got a error: {"error":"ActionRequestValidationException[Validation
Failed: 1: no requests added;]","status":500}
In terminal using curl -XPOST localhost:9200/_bulk -d '{ "index" :
{"_index":"test","_type":"one","_id":"1"}}\n{"name":"test","id":"1" }\n'
got the same error, and that's ok:
curl -XPOST localhost:9200/_bulk -d '{ "index" :
{"_index":"test","_type":"one","_id":"1"}}
{"name":"test","id":"1" }
'
Right now i have to build request body by my own, the guide
(http://www.elasticsearch.org/guide/reference/api/bulk/) said use newline
character \n, that'sexactly what i did, and it seems wrong, i wanna know
how to describe newline character in request body.
--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.