Class CreateRequest.Builder<TDocument>

java.lang.Object
co.elastic.clients.util.ObjectBuilderBase
co.elastic.clients.elasticsearch.core.CreateRequest.Builder<TDocument>
All Implemented Interfaces:
ObjectBuilder<CreateRequest<TDocument>>
Enclosing class:
CreateRequest<TDocument>

public static class CreateRequest.Builder<TDocument>
extends ObjectBuilderBase
implements ObjectBuilder<CreateRequest<TDocument>>
Builder for CreateRequest.
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • id

      public final CreateRequest.Builder<TDocument> id​(java.lang.String value)
      Required - Document ID

      API name: id

    • index

      public final CreateRequest.Builder<TDocument> index​(java.lang.String value)
      Required - The name of the index

      API name: index

    • pipeline

      public final CreateRequest.Builder<TDocument> pipeline​(@Nullable java.lang.String value)
      The pipeline id to preprocess incoming documents with

      API name: pipeline

    • refresh

      public final CreateRequest.Builder<TDocument> 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

    • routing

      public final CreateRequest.Builder<TDocument> routing​(@Nullable java.lang.String value)
      Specific routing value

      API name: routing

    • timeout

      public final CreateRequest.Builder<TDocument> timeout​(@Nullable Time value)
      Explicit operation timeout

      API name: timeout

    • timeout

      public final CreateRequest.Builder<TDocument> timeout​(java.util.function.Function<Time.Builder,​ObjectBuilder<Time>> fn)
      Explicit operation timeout

      API name: timeout

    • type

      public final CreateRequest.Builder<TDocument> type​(@Nullable java.lang.String value)
      The type of the document

      API name: type

    • version

      public final CreateRequest.Builder<TDocument> version​(@Nullable java.lang.Long value)
      Explicit version number for concurrency control

      API name: version

    • versionType

      public final CreateRequest.Builder<TDocument> versionType​(@Nullable VersionType value)
      Specific version type

      API name: version_type

    • waitForActiveShards

      public final CreateRequest.Builder<TDocument> waitForActiveShards​(@Nullable WaitForActiveShards value)
      Sets the number of shard copies that must be active before proceeding with the index 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

      public final CreateRequest.Builder<TDocument> waitForActiveShards​(java.util.function.Function<WaitForActiveShards.Builder,​ObjectBuilder<WaitForActiveShards>> fn)
      Sets the number of shard copies that must be active before proceeding with the index 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

    • document

      public final CreateRequest.Builder<TDocument> document​(TDocument value)
      Required - Request body.

      API name: _value_body

    • tDocumentSerializer

      public final CreateRequest.Builder<TDocument> tDocumentSerializer​(@Nullable JsonpSerializer<TDocument> value)
      Serializer for TDocument. If not set, an attempt will be made to find a serializer from the JSON context.
    • build

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