In the source code of Elasticsearch
, how it get the body of _bulk request
?
Such as the following request:
curl -i -XPOST 'http://localhost:9200/_bulk/?pretty' -d '
{ "delete" : {"_index" : "test", "_type" : "employee", "_id" : "3" } }
{ "create" : {"_index" : "test", "_type" : "employee", "_id" : "3"} }
{ "first_name" : "Reka", "last_name" : "Downey", "age" : 22, "about" : "I like new things!", "interests" : ["sport", "read"] }
{ "index" : {"_index" : "test", "_type" : "employee"} }
{ "first_name" : "Lily", "last_name" : "Smith", "age" : 23, "about" : "I like swimming!", "interests" : ["swim"] }
{ "update" : {"_index" : "test", "_type" : "employee", "_id" : "3"} }
{ "docs" : {"age" : 24} }'
now the question is how Elasticsearch
get the data in this request, which content is
{ "delete" : {"_index" : "test", "_type" : "employee", "_id" : "3" } }
{ "create" : {"_index" : "test", "_type" : "employee", "_id" : "3"} }
{ "first_name" : "Reka", "last_name" : "Downey", "age" : 22, "about" : "I like new things!", "interests" : ["sport", "read"] }
{ "index" : {"_index" : "test", "_type" : "employee"} }
{ "first_name" : "Lily", "last_name" : "Smith", "age" : 23, "about" : "I like swimming!", "interests" : ["swim"] }
{ "update" : {"_index" : "test", "_type" : "employee", "_id" : "3"} }
{ "docs" : {"age" : 24} }
the version of Elasticsearch is 2.3.1.
we know that in the org.elasticsearch.http.netty.HttpRequestHandler#messageReceived
method, we got the HttpRequest
object; so now I want to know how to get the content through the HttpRequest
object?
Request your kind help!
Thanks!
Reka!