🏡 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>

Use Case 1: JSON Files in python

How do I index a JSON file consisting of an array of objects in python?

Approach


Use Case 2: Array of Objects in nodejs

How do I bulk-index an array of objects in javascript?

Approach

Remarks