BULK API RFC - multi-objects POST

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!

From Elastic Search to Elasticsearch

  1. I'm not sure there is (may be this: GitHub - ndjson/ndjson-spec: Specification). 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.

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