Class IndexRequest<TDocument>
java.lang.Object
co.elastic.clients.elasticsearch._types.RequestBase
co.elastic.clients.elasticsearch.core.IndexRequest<TDocument>
- All Implemented Interfaces:
JsonpSerializable
@JsonpDeserializable
public class IndexRequest<TDocument>
extends RequestBase
implements JsonpSerializable
Creates or updates a document in an index.
- See Also:
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class co.elastic.clients.elasticsearch._types.RequestBase
RequestBase.AbstractBuilder<BuilderT extends RequestBase.AbstractBuilder<BuilderT>> -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final JsonpDeserializer<IndexRequest<Object>>Json deserializer forIndexRequestbased on named deserializers provided by the callingJsonMapper.static final Endpoint<IndexRequest<?>,IndexResponse, ErrorResponse> Endpoint "index". -
Method Summary
Modifier and TypeMethodDescriptionstatic <TDocument>
JsonpDeserializer<IndexRequest<TDocument>>createIndexRequestDeserializer(JsonpDeserializer<TDocument> tDocumentDeserializer) final TDocumentdocument()Required - Request body.final Stringid()Document IDfinal Longonly perform the index operation if the last operation that has changed the document has the specified primary termfinal LongifSeqNo()only perform the index operation if the last operation that has changed the document has the specified sequence numberfinal Stringindex()Required - The name of the indexstatic <TDocument>
IndexRequest<TDocument>of(Function<IndexRequest.Builder<TDocument>, ObjectBuilder<IndexRequest<TDocument>>> fn) final OpTypeopType()Explicit operation type.final Stringpipeline()The pipeline id to preprocess incoming documents withfinal Refreshrefresh()Iftruethen refresh the affected shards to make this operation visible to search, ifwait_forthen wait for a refresh to make this operation visible to search, iffalse(the default) then do nothing with refreshes.final BooleanWhen true, requires destination to be an alias.final Stringrouting()Specific routing valuevoidserialize(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper) Serialize this value to JSON.final Timetimeout()Explicit operation timeoutfinal Stringtype()The type of the documentfinal Longversion()Explicit version number for concurrency controlfinal VersionTypeSpecific version typefinal WaitForActiveShardsSets the number of shard copies that must be active before proceeding with the index operation.Methods inherited from class co.elastic.clients.elasticsearch._types.RequestBase
toString
-
Field Details
-
_DESERIALIZER
Json deserializer forIndexRequestbased on named deserializers provided by the callingJsonMapper. -
_ENDPOINT
Endpoint "index".
-
-
Method Details
-
of
public static <TDocument> IndexRequest<TDocument> of(Function<IndexRequest.Builder<TDocument>, ObjectBuilder<IndexRequest<TDocument>>> fn) -
id
Document IDAPI name:
id -
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
only perform the index operation if the last operation that has changed the document has the specified sequence numberAPI name:
if_seq_no -
index
Required - The name of the indexAPI name:
index -
opType
Explicit operation type. Defaults toindexfor requests with an explicit document ID, and tocreatefor requests without an explicit document IDAPI name:
op_type -
pipeline
The pipeline id to preprocess incoming documents withAPI name:
pipeline -
refresh
Iftruethen refresh the affected shards to make this operation visible to search, ifwait_forthen wait for a refresh to make this operation visible to search, iffalse(the default) then do nothing with refreshes.API name:
refresh -
requireAlias
When true, requires destination to be an alias. Default is falseAPI name:
require_alias -
routing
Specific routing valueAPI name:
routing -
timeout
Explicit operation timeoutAPI name:
timeout -
type
The type of the documentAPI name:
type -
version
Explicit version number for concurrency controlAPI name:
version -
versionType
Specific version typeAPI name:
version_type -
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 toallfor 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
Required - Request body. -
serialize
Serialize this value to JSON.- Specified by:
serializein interfaceJsonpSerializable
-
createIndexRequestDeserializer
public static <TDocument> JsonpDeserializer<IndexRequest<TDocument>> createIndexRequestDeserializer(JsonpDeserializer<TDocument> tDocumentDeserializer)
-