# Bulk API Documentation update request

**URL:** <https://discuss.elastic.co/t/bulk-api-documentation-update-request/160039>\
**Category:** Elasticsearch\
**Created:** [December 9, 2018, 10:46am UTC](https://discuss.elastic.co/t/bulk-api-documentation-update-request/160039 "2018-12-09T10:46:06Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jamalarm](https://avatars.discourse-cdn.com/v4/letter/j/3e96dc/32.png) [@Jamalarm](https://discuss.elastic.co/u/Jamalarm)\
**Post date:** [December 9, 2018, 10:46am UTC](https://discuss.elastic.co/t/bulk-api-documentation-update-request/160039/1 "2018-12-09T10:46:06Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [December 10, 2018, 4:53pm UTC](https://discuss.elastic.co/t/bulk-api-documentation-update-request/160039/2 "2018-12-10T16:53:30Z")

</div>

> [@Jamalarm](#):
>
> 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)?

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](https://github.com/elastic/elasticsearch/pull/36441).

(Not all of us are guys)

---

<div class="post-metadata">

**Author:** ![Jamalarm](https://avatars.discourse-cdn.com/v4/letter/j/3e96dc/32.png) [@Jamalarm](https://discuss.elastic.co/u/Jamalarm)\
**Post date:** [December 10, 2018, 5:08pm UTC](https://discuss.elastic.co/t/bulk-api-documentation-update-request/160039/3 "2018-12-10T17:08:42Z")

</div>

Awesome! Thanks for the speedy update David.

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

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [January 7, 2019, 5:08pm UTC](https://discuss.elastic.co/t/bulk-api-documentation-update-request/160039/4 "2019-01-07T17:08:49Z")

</div>

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