Class CreateRequest<TDocument>
java.lang.Object
co.elastic.clients.elasticsearch._types.RequestBase
co.elastic.clients.elasticsearch.core.CreateRequest<TDocument>
- All Implemented Interfaces:
JsonpSerializable
@JsonpDeserializable
public class CreateRequest<TDocument>
extends RequestBase
implements JsonpSerializable
Creates a new document in the index.
Returns a 409 response when a document with a same ID already exists in the index.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class co.elastic.clients.elasticsearch._types.RequestBase
RequestBase.AbstractBuilder<BuilderT extends RequestBase.AbstractBuilder<BuilderT>>
-
Field Summary
Modifier and TypeFieldDescriptionstatic final JsonpDeserializer<CreateRequest<Object>>
Json deserializer forCreateRequest
based on named deserializers provided by the callingJsonMapper
.static final Endpoint<CreateRequest<?>,
CreateResponse, ErrorResponse> Endpoint "create
". -
Method Summary
Modifier and TypeMethodDescriptionstatic <TDocument>
JsonpDeserializer<CreateRequest<TDocument>>createCreateRequestDeserializer
(JsonpDeserializer<TDocument> tDocumentDeserializer) final TDocument
document()
Required - Request body.final String
id()
Required - Document IDfinal String
index()
Required - The name of the indexstatic <TDocument>
CreateRequest<TDocument>of
(Function<CreateRequest.Builder<TDocument>, ObjectBuilder<CreateRequest<TDocument>>> fn) final String
pipeline()
The pipeline id to preprocess incoming documents withfinal Refresh
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.final String
routing()
Specific routing valuevoid
serialize
(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper) Serialize this value to JSON.final Time
timeout()
Explicit operation timeoutfinal Long
version()
Explicit version number for concurrency controlfinal VersionType
Specific version typefinal WaitForActiveShards
Sets 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 forCreateRequest
based on named deserializers provided by the callingJsonMapper
. -
_ENDPOINT
Endpoint "create
".
-
-
Method Details
-
of
public static <TDocument> CreateRequest<TDocument> of(Function<CreateRequest.Builder<TDocument>, ObjectBuilder<CreateRequest<TDocument>>> fn) -
id
Required - Document IDAPI name:
id
-
index
Required - The name of the indexAPI name:
index
-
pipeline
The pipeline id to preprocess incoming documents withAPI name:
pipeline
-
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
Specific routing valueAPI name:
routing
-
timeout
Explicit operation timeoutAPI name:
timeout
-
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 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
-
document
Required - Request body. -
serialize
Serialize this value to JSON.- Specified by:
serialize
in interfaceJsonpSerializable
-
createCreateRequestDeserializer
public static <TDocument> JsonpDeserializer<CreateRequest<TDocument>> createCreateRequestDeserializer(JsonpDeserializer<TDocument> tDocumentDeserializer)
-