Class IndexRequest<TDocument>

java.lang.Object
co.elastic.clients.elasticsearch._types.RequestBase
co.elastic.clients.elasticsearch._core.IndexRequest<TDocument>
All Implemented Interfaces:
ElasticsearchCommonRequest, JsonpSerializable

public final class IndexRequest<TDocument>
extends RequestBase
implements JsonpSerializable
  • Field Details

  • Constructor Details

  • Method Details

    • id

      @Nullable public java.lang.String id()
      Document ID

      API name: id

    • index

      public java.lang.String index()
      Required - The name of the index

      API name: index

    • type

      @Nullable public java.lang.String type()
      The type of the document

      API name: type

    • ifPrimaryTerm

      @Nullable public java.lang.Long ifPrimaryTerm()
      only perform the index operation if the last operation that has changed the document has the specified primary term

      API name: if_primary_term

    • ifSeqNo

      @Nullable public java.lang.Integer ifSeqNo()
      only perform the index operation if the last operation that has changed the document has the specified sequence number

      API name: if_seq_no

    • opType

      @Nullable public OpType opType()
      Explicit operation type. Defaults to index for requests with an explicit document ID, and to createfor requests without an explicit document ID

      API name: op_type

    • pipeline

      @Nullable public java.lang.String pipeline()
      The pipeline id to preprocess incoming documents with

      API name: pipeline

    • refresh

      @Nullable public jakarta.json.JsonValue refresh()
      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

      @Nullable public java.lang.String routing()
      Specific routing value

      API name: routing

    • timeout

      @Nullable public java.lang.String timeout()
      Explicit operation timeout

      API name: timeout

    • version

      @Nullable public java.lang.Long version()
      Explicit version number for concurrency control

      API name: version

    • versionType

      @Nullable public VersionType versionType()
      Specific version type

      API name: version_type

    • waitForActiveShards

      @Nullable public jakarta.json.JsonValue waitForActiveShards()
      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

    • requireAlias

      @Nullable public java.lang.Boolean requireAlias()
      When true, requires destination to be an alias. Default is false

      API name: require_alias

    • document

      public TDocument document()
      Required - Request body.

      API name: _value_body

    • serialize

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

      public static <TDocument> JsonpDeserializer<IndexRequest<TDocument>> createIndexRequestDeserializer​(JsonpDeserializer<TDocument> tDocumentDeserializer)