Bulk update successful, but documents aren't updated

I added new field to mapping, and then try to update all documents with new values for this field.

curl -XPOST 'https://my_end_point/myindex/mytype/_bulk' -d '
{"update":{"_id":"1"}}
{"doc": { "test_field": "new field value 1"}}
{"update":{"_id":"2"}}
{"doc": { "test_field": "new field value 2"}}
{"update":{"_id":"3"}}
{"doc": { "test_field": "new field value 3"}}
{"update":{"_id":"4"}}
{"doc": { "test_field": "new field value 4"}}'

OUTPUT:
{"took":21,"errors":false,"items":[{"update":{"_index":"myindex","_type":"mytype","_id":"1","_version":3,"status":200}},{"update":{"_index":"myindex","_type":"mytype","_id":"2","_version":2,"status":200}},{"update":{"_index":"myindex","_type":"mytype","_id":"3","_version":2,"status":200}}]}%

Then I am trying to retrieve all hits:
curl -XGET 'https://my_end_point/myindex/mytype/_search?pretty'

But hits does not contain new field with new value. They remaining the same as before bulk update
Did I make a mistake or miss something?

!!!! UPDATE: I can see updated fields, all except for the last one. I don't see document with id 4 (which is the last one) to be updated

You are missing the last line return at the end.

1 Like

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