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
Adds a JSON document to the specified data stream or index and makes it
searchable. If the target is an index and the document already exists, the
request updates the document and increments its version.
- 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<CreateRequest<Object>>Json deserializer forCreateRequestbased 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 TDocumentdocument()Required - Request body.final Stringid()Required - Unique identifier for the document.final Stringindex()Required - Name of the data stream or index to target.static <TDocument>
CreateRequest<TDocument>of(Function<CreateRequest.Builder<TDocument>, ObjectBuilder<CreateRequest<TDocument>>> fn) final Stringpipeline()ID of the pipeline to use to preprocess incoming documents.final Refreshrefresh()Iftrue, Elasticsearch refreshes the affected shards to make this operation visible to search, ifwait_forthen wait for a refresh to make this operation visible to search, iffalsedo nothing with refreshes.final Stringrouting()Custom value used to route operations to a specific shard.voidserialize(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper) Serialize this value to JSON.final Timetimeout()Period the request waits for the following operations: automatic index creation, dynamic mapping updates, waiting for active shards.final Longversion()Explicit version number for concurrency control.final VersionTypeSpecific version type:external,external_gte.final WaitForActiveShardsThe number of shard copies that must be active before proceeding with the operation.Methods inherited from class co.elastic.clients.elasticsearch._types.RequestBase
toString
-
Field Details
-
_DESERIALIZER
Json deserializer forCreateRequestbased 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 - Unique identifier for the document.API name:
id -
index
Required - Name of the data stream or index to target. If the target doesn’t exist and matches the name or wildcard (*) pattern of an index template with adata_streamdefinition, this request creates the data stream. If the target doesn’t exist and doesn’t match a data stream template, this request creates the index.API name:
index -
pipeline
ID of the pipeline to use to preprocess incoming documents. If the index has a default ingest pipeline specified, then setting the value to_nonedisables the default ingest pipeline for this request. If a final pipeline is configured it will always run, regardless of the value of this parameter.API name:
pipeline -
refresh
Iftrue, Elasticsearch refreshes the affected shards to make this operation visible to search, ifwait_forthen wait for a refresh to make this operation visible to search, iffalsedo nothing with refreshes. Valid values:true,false,wait_for.API name:
refresh -
routing
Custom value used to route operations to a specific shard.API name:
routing -
timeout
Period the request waits for the following operations: automatic index creation, dynamic mapping updates, waiting for active shards.API name:
timeout -
version
Explicit version number for concurrency control. The specified version must match the current version of the document for the request to succeed.API name:
version -
versionType
Specific version type:external,external_gte.API name:
version_type -
waitForActiveShards
The number of shard copies that must be active before proceeding with the operation. Set toallor any positive integer up to the total number of shards in the index (number_of_replicas+1).API name:
wait_for_active_shards -
document
Required - Request body. -
serialize
Serialize this value to JSON.- Specified by:
serializein interfaceJsonpSerializable
-
createCreateRequestDeserializer
public static <TDocument> JsonpDeserializer<CreateRequest<TDocument>> createCreateRequestDeserializer(JsonpDeserializer<TDocument> tDocumentDeserializer)
-