Open
Description
The bulk API can be used to index multiple documents into Elasticsearch by constructing a bulk request containing multiple documents, and executing against Elasticsearch. When the number of documents is large however, a consumer needs to construct multiple bulk requests, each containing a slice of the documents to be indexed, and execute these against Elasticsearch.
Many of the existing Elasticsearch clients provide a "bulk helper" for this purpose. The helper can be:
- provided a large collection of documents: this could be as a stream, lazy iterable, etc.
- slice the collection into "chunks": this could be by number of documents or by request byte size
- execute multiple concurrent requests against Elasticsearch to index documents
- optionally backoff and retry indexing documents that fail to be indexed signalled by a 429
Too Many Requests
HTTP response.
An example helper is the BulkAllObservable
from the C#/.NET client.
The Rust client should provide a similar, idiomatic way of helping consumers bulk index a large collection of documents.