In this section, we will discuss various bulk operations Elasticsearch supports. Batching multiple requests together saves network round trips, and the requests in the batch can be executed in parallel. Elasticsearch has a dedicated thread pool for bulk operations, and the number of requests it can process in parallel depends on the number of the CPU processors in the node.
The following are the different bulk operations supported:
- Bulk API: This can be used to batch multiple index and delete operations and execute them using a single API call.
- Multi Get API: This can be used to retrieve documents using document IDs.
- Update by query: This can be used to update a set of documents that match a query.
- Delete by query: This can be used to delete the documents that match a query.