🏡 Home 📖 Chapter Home 👈 Prev 👉 Next
⚡ ElasticsearchBook.com is crafted by Jozef Sorocin and powered by:
Once you've established a solid mapping, you'll want to index multiple documents at once using the Bulk API. A typical payload to the _bulk
endpoint would be sent as newline-delimited JSON (ndjson
) but since this format is quite verbose and often hard to get right, it's helpful to use the client libraries' helpers instead. Nonetheless, we'll cover the ndjson
format too in case you don't plan on using any client library.
<aside> 💡 There's no "optimal" payload chunk size due to a plethora of factors but a good amount to start with is 1,000 documents, or 5MB per request.
</aside>
How do I index a JSON file consisting of an array of objects in python?
[requests](<https://requests.readthedocs.io/en/master/>)
[elasticsearch-py](<https://elasticsearch-py.rtfd.org/>)
libraryHow do I bulk-index an array of objects in javascript?
[@elastic/elasticsearch](<https://www.npmjs.com/package/@elastic/elasticsearch>)
[AWS.NodeHttpClient()](<https://github.com/aws/aws-sdk-js/blob/master/lib/http/node.js#L11>)