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 default list of fields to return, can be overridden on each sub-request

      API name: _source

    • source

      True or false to return the _source field or not, or default list of fields to return, can be overridden on each sub-request

      API name: _source

    • sourceExcludes

      public final BulkRequest.Builder sourceExcludes(List<String> list)
      Default list of fields to exclude from the returned _source field, can be overridden on each sub-request

      API name: _source_excludes

      Adds all elements of list to sourceExcludes.

    • sourceExcludes

      public final BulkRequest.Builder sourceExcludes(String value, String... values)
      Default list of fields to exclude from the returned _source field, can be overridden on each sub-request

      API name: _source_excludes

      Adds one or more values to sourceExcludes.

    • sourceIncludes

      public final BulkRequest.Builder sourceIncludes(List<String> list)
      Default list of fields to extract and return from the _source field, can be overridden on each sub-request

      API name: _source_includes

      Adds all elements of list to sourceIncludes.

    • sourceIncludes

      public final BulkRequest.Builder sourceIncludes(String value, String... values)
      Default list of fields to extract and return from the _source field, can be overridden on each sub-request

      API name: _source_includes

      Adds one or more values to sourceIncludes.

    • index

      public final BulkRequest.Builder index(@Nullable String value)
      Default index for items which don't provide one

      API name: index

    • pipeline

      public final BulkRequest.Builder pipeline(@Nullable String value)
      The pipeline id to preprocess incoming documents with

      API name: pipeline

    • refresh

      public final BulkRequest.Builder refresh(@Nullable Refresh value)
      If true then refresh 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 (the default) then do nothing with refreshes.

      API name: refresh

    • requireAlias

      public final BulkRequest.Builder requireAlias(@Nullable Boolean value)
      Sets require_alias for all incoming documents. Defaults to unset (false)

      API name: require_alias

    • routing

      public final BulkRequest.Builder routing(@Nullable String value)
      Specific routing value

      API name: routing

    • timeout

      public final BulkRequest.Builder timeout(@Nullable Time value)
      Explicit operation timeout

      API name: timeout

    • timeout

      Explicit operation timeout

      API name: timeout

    • waitForActiveShards

      public final BulkRequest.Builder waitForActiveShards(@Nullable WaitForActiveShards value)
      Sets the number of shard copies that must be active before proceeding with the bulk operation. Defaults to 1, meaning the primary shard only. Set to all for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1)

      API name: wait_for_active_shards

    • waitForActiveShards

      Sets the number of shard copies that must be active before proceeding with the bulk operation. Defaults to 1, meaning the primary shard only. Set to all for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (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.