Getting _source fields with bulk api

The Bulk API docs mention the query parameter _source, however, when I add the parameter to the request, no source fields are included.

For example:
curl -X POST "localhost:9200/_bulk?_source=field1" -H 'Content-Type: application/json' -d'
{ "index" : { "_index" : "test", "_id" : "1" } }
{ "field1" : "value1" }
{ "index" : { "_index" : "test", "_id" : "3" } }
{ "field1" : "value3" }
{ "index" : {"_id" : "2", "_index" : "test"} }
{ "doc" : {"field2" : "value2"} }
'
This returns the normal response but doesn't include field1 from _source as requested.
Am I missing something?

I think this is a documentation bug. The Bulk API is for indexing and doesn't return the document's source. Would you open an issue at https://github.com/elastic/elasticsearch/issues please?

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.