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
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
IndexRequest.Builder<TDocument>
Builder forIndexRequest
.Nested classes/interfaces inherited from class co.elastic.clients.elasticsearch._types.RequestBase
RequestBase.AbstractBuilder<BuilderT extends RequestBase.AbstractBuilder<BuilderT>>
-
Field Summary
Fields Modifier and Type Field Description static Endpoint<IndexRequest<?>,IndexResponse,ElasticsearchError>
ENDPOINT
Endpoint "index
". -
Constructor Summary
Constructors Constructor Description IndexRequest(IndexRequest.Builder<TDocument> builder)
IndexRequest(java.util.function.Function<IndexRequest.Builder<TDocument>,IndexRequest.Builder<TDocument>> fn)
-
Method Summary
Modifier and Type Method Description static <TDocument>
JsonpDeserializer<IndexRequest<TDocument>>createIndexRequestDeserializer(JsonpDeserializer<TDocument> tDocumentDeserializer)
TDocument
document()
Required - Request body.java.lang.String
id()
Document IDjava.lang.Long
ifPrimaryTerm()
only perform the index operation if the last operation that has changed the document has the specified primary termjava.lang.Integer
ifSeqNo()
only perform the index operation if the last operation that has changed the document has the specified sequence numberjava.lang.String
index()
Required - The name of the indexOpType
opType()
Explicit operation type.java.lang.String
pipeline()
The pipeline id to preprocess incoming documents withjakarta.json.JsonValue
refresh()
Iftrue
then refresh the affected shards to make this operation visible to search, ifwait_for
then wait for a refresh to make this operation visible to search, iffalse
(the default) then do nothing with refreshes.java.lang.Boolean
requireAlias()
When true, requires destination to be an alias.java.lang.String
routing()
Specific routing valuevoid
serialize(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper)
Serialize this value to JSON.java.lang.String
timeout()
Explicit operation timeoutjava.lang.String
type()
The type of the documentjava.lang.Long
version()
Explicit version number for concurrency controlVersionType
versionType()
Specific version typejakarta.json.JsonValue
waitForActiveShards()
Sets the number of shard copies that must be active before proceeding with the index operation.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
ENDPOINT
Endpoint "index
".
-
-
Constructor Details
-
IndexRequest
-
IndexRequest
public IndexRequest(java.util.function.Function<IndexRequest.Builder<TDocument>,IndexRequest.Builder<TDocument>> fn)
-
-
Method Details
-
id
@Nullable public java.lang.String id()Document IDAPI name:
id
-
index
public java.lang.String index()Required - The name of the indexAPI name:
index
-
type
@Nullable public java.lang.String type()The type of the documentAPI 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 termAPI 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 numberAPI name:
if_seq_no
-
opType
Explicit operation type. Defaults toindex
for requests with an explicit document ID, and tocreate
for requests without an explicit document IDAPI name:
op_type
-
pipeline
@Nullable public java.lang.String pipeline()The pipeline id to preprocess incoming documents withAPI name:
pipeline
-
refresh
@Nullable public jakarta.json.JsonValue refresh()Iftrue
then refresh the affected shards to make this operation visible to search, ifwait_for
then wait for a refresh to make this operation visible to search, iffalse
(the default) then do nothing with refreshes.API name:
refresh
-
routing
@Nullable public java.lang.String routing()Specific routing valueAPI name:
routing
-
timeout
@Nullable public java.lang.String timeout()Explicit operation timeoutAPI name:
timeout
-
version
@Nullable public java.lang.Long version()Explicit version number for concurrency controlAPI name:
version
-
versionType
Specific version typeAPI 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 toall
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 falseAPI name:
require_alias
-
document
Required - Request body.API name:
_value_body
-
serialize
Serialize this value to JSON.- Specified by:
serialize
in interfaceJsonpSerializable
-
createIndexRequestDeserializer
public static <TDocument> JsonpDeserializer<IndexRequest<TDocument>> createIndexRequestDeserializer(JsonpDeserializer<TDocument> tDocumentDeserializer)
-