elastic/elasticsearch

Missing ID for an update/delete operation causes the entire bulk to fail

Open

#10.428 aperta il 4 apr 2015

Vedi su GitHub
 (6 commenti) (0 reazioni) (0 assegnatari)Java (25.882 fork)batch import
:Distributed/CRUD>bugTeam:Distributedhelp wanted

Metriche repository

Star
 (76.700 star)
Metriche merge PR
 (Merge medio 2g) (1000 PR mergiate in 30 g)

Descrizione

If one of the actions from a bulk requires an ID (update/delete) but doesn't have it, the entire bulk fails. For example:

$ cat /tmp/test_bulk 
{"index":{}}
{"name":"test doc"}
{"delete":{}}

$ curl -XPOST localhost:9200/test/test/_bulk?pretty --data-binary @/tmp/test_bulk
{
  "error" : "ActionRequestValidationException[Validation Failed: 1: id is missing;]",
  "status" : 400
}

I would expect the index operation to succeed and the delete/update operation to fail. Or maybe there's a good reason for failing the whole bulk that I don't see?

Guida contributor