Class BulkRequest.Builder

All Implemented Interfaces:
WithJson<BulkRequest.Builder>, ObjectBuilder<BulkRequest>
Enclosing class:
BulkRequest

public static class BulkRequest.Builder extends RequestBase.AbstractBuilder<BulkRequest.Builder> implements ObjectBuilder<BulkRequest>
Builder for BulkRequest.
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • source

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

      API name: _source

    • source

      true or false to return the _source field or not, or a list of fields to return.

      API name: _source

    • sourceExcludes

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

      API name: _source_excludes

      Adds all elements of list to sourceExcludes.

    • sourceExcludes

      public final BulkRequest.Builder sourceExcludes(String value, String... values)
      A comma-separated list of source fields to exclude from the response.

      API name: _source_excludes

      Adds one or more values to sourceExcludes.

    • sourceIncludes

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

      API name: _source_includes

      Adds all elements of list to sourceIncludes.

    • sourceIncludes

      public final BulkRequest.Builder sourceIncludes(String value, String... values)
      A comma-separated list of source fields to include in the response.

      API name: _source_includes

      Adds one or more values to sourceIncludes.

    • index

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

      API name: index

    • pipeline

      public final BulkRequest.Builder pipeline(@Nullable String value)
      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

      public final BulkRequest.Builder refresh(@Nullable Refresh value)
      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

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

      API name: require_alias

    • routing

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

      API name: routing

    • timeout

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

      API name: timeout

    • timeout

      Period each action waits for the following operations: automatic index creation, dynamic mapping updates, waiting for active shards.

      API name: timeout

    • waitForActiveShards

      public final BulkRequest.Builder waitForActiveShards(@Nullable WaitForActiveShards value)
      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

    • 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 BulkRequest.Builder operations(List<BulkOperation> list)
      Required - Request body.

      Adds all elements of list to operations.

    • operations

      public final BulkRequest.Builder operations(BulkOperation value, BulkOperation... values)
      Required - Request body.

      Adds one or more values to operations.

    • operations

      Required - Request body.

      Adds a value to operations using a builder lambda.

    • self

      protected BulkRequest.Builder self()
      Specified by:
      self in class RequestBase.AbstractBuilder<BulkRequest.Builder>
    • build

      public BulkRequest build()
      Builds a BulkRequest.
      Specified by:
      build in interface ObjectBuilder<BulkRequest>
      Throws:
      NullPointerException - if some of the required fields are null.