Bulk API Documentation update request

Hi Guys,

I'm writing component at the moment that is basically a glorified ingest pipeline. We use the _bulk endpoint extensively. Currently, just prior to invocation, we store a map of _index+_id -> document and then compare the response of _bulk to it to determine which documents were successfully stored.

Now, the problem we are encountering is that we are using aliases, and the _bulk API returns the _index that was actually used, not the alias that was requested, so our map-based approach doesn't work.

After Googling around a bit, I was surprised to discover that the _bulk API seems to guarantee the order of the responses, in that the order responses are reported is the same order they were originally requested. This works great for us, and we can get rid of this map-based lookup approach.

Problem is: it's not officially documented anywhere. I can only find answers in this forum saying that it's guaranteed, but I'm hesitant to rely on this semantic until it is officially stated in the documentation (losing any data would be a real problem for us).

Could you guys please update the _bulk API page to officially state that the order is preserved (and that it won't be changed without a breaking change notification)?

Thanks!

Yes, thanks for raising this. I checked, and there are tests that verify this, so I opened Clarify the order of responses to a bulk request by DaveCTurner · Pull Request #36441 · elastic/elasticsearch · GitHub.

(Not all of us are guys)

Awesome! Thanks for the speedy update David.

And you're right, I'll pick a more inclusive collective noun next time :slight_smile:

1 Like

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