Elasticsearch Bulk

By Opster Team

Updated: May 24, 2023

| 1 min read

Before you dig into the details of this technical guide, have you tried asking OpsGPT?

You'll receive concise answers that will help streamline your Elasticsearch/OpenSearch operations.


Try OpsGPT now for step-by-step guidance and tailored insights into your Elasticsearch/ OpenSearch operation.

Overview

In Elasticsearch, when using the Bulk API it is possible to perform many write operations in a single API call, which increases the indexing speed. Using the Bulk API is more efficient than sending multiple separate requests. This can be done for the following four actions:

Examples

The bulk request below will index a document, delete another document, and update an existing document.

POST _bulk
{ "index" : { "_index" : "myindex", "_id" : "1" } }
{ "field1" : "value" }
{ "delete" : { "_index" : "myindex", "_id" : "2" } }
{ "update" : {"_id" : "1", "_index" : "myindex"} }
{ "doc" : {"field2" : "value5"} }

Notes

  • Bulk API is useful when you need to index data streams that can be queued up and indexed in batches of hundreds or thousands, such as logs.
  • There is no correct number of actions or limits to perform on a single bulk call, but you will need to figure out the optimum number by experimentation, given the cluster size, number of nodes, hardware specs etc.

How helpful was this guide?

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?


Related log errors to this ES concept


Error while executing bulk request
Error while attempting to bulk index documents
Error executing bulk
Failed to properly close watcher bulk processor
Bulk index of results has errors
Failed to shut down ILM history bulk processor after 10 seconds
Bulk request has been cancelled
Failed to execute bulk request
Failed to execute pipeline for a bulk request
Failed to bulk index audit events
Exporter failed to open exporting bulk
Mapping update rejected by primary

< Page: 1 of 4 >

Get expert answers on Elasticsearch/OpenSearch