Class BulkRequest

java.lang.Object
co.elastic.clients.elasticsearch._types.RequestBase
co.elastic.clients.elasticsearch.core.BulkRequest
All Implemented Interfaces:
JsonpSerializable, NdJsonpSerializable

public class BulkRequest extends RequestBase implements NdJsonpSerializable, JsonpSerializable
Performs multiple indexing or delete operations in a single API call. This reduces overhead and can greatly increase indexing speed.
See Also:
  • Field Details

  • Method Details

    • of

    • _serializables

      public Iterator<?> _serializables()
      Specified by:
      _serializables in interface NdJsonpSerializable
    • source

      @Nullable public final SourceConfigParam source()
      true or false to return the _source field or not, or a list of fields to return.

      API name: _source

    • sourceExcludes

      public final List<String> sourceExcludes()
      A comma-separated list of source fields to exclude from the response.

      API name: _source_excludes

    • sourceIncludes

      public final List<String> sourceIncludes()
      A comma-separated list of source fields to include in the response.

      API name: _source_includes

    • index

      @Nullable public final String index()
      Name of the data stream, index, or index alias to perform bulk actions on.

      API name: index

    • pipeline

      @Nullable public final String pipeline()
      ID of the pipeline to use to preprocess incoming documents. If the index has a default ingest pipeline specified, then setting the value to _none disables the default ingest pipeline for this request. If a final pipeline is configured it will always run, regardless of the value of this parameter.

      API name: pipeline

    • refresh

      @Nullable public final Refresh refresh()
      If true, Elasticsearch refreshes the affected shards to make this operation visible to search, if wait_for then wait for a refresh to make this operation visible to search, if false do nothing with refreshes. Valid values: true, false, wait_for.

      API name: refresh

    • requireAlias

      @Nullable public final Boolean requireAlias()
      If true, the request’s actions must target an index alias.

      API name: require_alias

    • routing

      @Nullable public final String routing()
      Custom value used to route operations to a specific shard.

      API name: routing

    • timeout

      @Nullable public final Time timeout()
      Period each action waits for the following operations: automatic index creation, dynamic mapping updates, waiting for active shards.

      API name: timeout

    • waitForActiveShards

      @Nullable public final WaitForActiveShards waitForActiveShards()
      The number of shard copies that must be active before proceeding with the operation. Set to all or any positive integer up to the total number of shards in the index (number_of_replicas+1).

      API name: wait_for_active_shards

    • operations

      public final List<BulkOperation> operations()
      Required - Request body.
    • serialize

      public void serialize(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper)
      Serialize this value to JSON.
      Specified by:
      serialize in interface JsonpSerializable