# BULK API RFC - multi-objects POST

**URL:** <https://discuss.elastic.co/t/bulk-api-rfc-multi-objects-post/363228>\
**Category:** Elasticsearch\
**Created:** [July 16, 2024, 2:23pm UTC](https://discuss.elastic.co/t/bulk-api-rfc-multi-objects-post/363228 "2024-07-16T14:23:57Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Adrien\_WATTEZ](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/adrien_wattez/32/123610_2.png) [@Adrien\_WATTEZ](https://discuss.elastic.co/u/Adrien_WATTEZ)\
**Post date:** [July 16, 2024, 2:23pm UTC](https://discuss.elastic.co/t/bulk-api-rfc-multi-objects-post/363228/1 "2024-07-16T14:23:57Z")

</div>

Hi Elastic Community,

I am currently exploring the Bulk API and seeking some clarification and guidance regarding the submission of multiple objects in a single REST POST request. Specifically, I have the following questions:

1. **Is there an RFC or standard documentation that specifies the usage of multiple objects in a REST POST request instead of an array?** I have reviewed various resources but have not found a definitive RFC that addresses this practice. If anyone is aware of such a document, I would greatly appreciate a reference.
2. **How is this implemented with Jackson in Java?** For those who have experience with Jackson, could you provide examples or best practices on how to handle the submission of multiple objects within a single POST request when using the Bulk API?

Your insights and examples will be highly valuable for ensuring that our implementation adheres to best practices and standards.

Thank you in advance for your help!

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [July 16, 2024, 3:37pm UTC](https://discuss.elastic.co/t/bulk-api-rfc-multi-objects-post/363228/2 "2024-07-16T15:37:12Z")

</div>

From #Elastic Search to #Elasticsearch

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [July 16, 2024, 3:42pm UTC](https://discuss.elastic.co/t/bulk-api-rfc-multi-objects-post/363228/3 "2024-07-16T15:42:46Z")

</div>

1. I'm not sure there is (may be this: [GitHub - ndjson/ndjson-spec: Specification](https://github.com/ndjson/ndjson-spec)). But there's a reason for that.

When you send a bulk request, Elasticsearch needs to process it and reroute the request to the right shard.  
If this was part of a json array, that'd mean that Elasticsearch must read and hold in memory the whole bulk request.  
With this way, Elasticsearch has only to read the header line, parse it and reroute the payload to the right shard without the need of reading the payload.

So there's not really Jackson implied in this. Only when the payload is parsed or when the header is parsed. Which means one line at a 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:** [August 13, 2024, 3:43pm UTC](https://discuss.elastic.co/t/bulk-api-rfc-multi-objects-post/363228/4 "2024-08-13T15:43:11Z")

</div>

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