Class CreateRequest<TDocument>
- java.lang.Object
-
- org.opensearch.client.opensearch._types.RequestBase
-
- org.opensearch.client.opensearch.core.CreateRequest<TDocument>
-
- All Implemented Interfaces:
JsonpSerializable
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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classCreateRequest.Builder<TDocument>Builder forCreateRequest.-
Nested classes/interfaces inherited from class org.opensearch.client.opensearch._types.RequestBase
RequestBase.AbstractBuilder<BuilderT extends RequestBase.AbstractBuilder<BuilderT>>
-
-
Field Summary
Fields Modifier and Type Field Description static Endpoint<CreateRequest<?>,CreateResponse,ErrorResponse>_ENDPOINTEndpoint "create".
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <TDocument>
JsonpDeserializer<CreateRequest<TDocument>>createCreateRequestDeserializer(JsonpDeserializer<TDocument> tDocumentDeserializer)TDocumentdocument()Required - Request body.java.lang.Stringid()Required - Document IDjava.lang.Stringindex()Required - The name of the indexstatic <TDocument>
CreateRequest<TDocument>of(java.util.function.Function<CreateRequest.Builder<TDocument>,ObjectBuilder<CreateRequest<TDocument>>> fn)java.lang.Stringpipeline()The pipeline id to preprocess incoming documents withRefreshrefresh()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.java.lang.Stringrouting()Specific routing valuevoidserialize(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper)Serialize this value to JSON.Timetimeout()Explicit operation timeoutjava.lang.Longversion()Explicit version number for concurrency controlVersionTypeversionType()Specific version typeWaitForActiveShardswaitForActiveShards()Sets the number of shard copies that must be active before proceeding with the index operation.
-
-
-
Field Detail
-
_ENDPOINT
public static final Endpoint<CreateRequest<?>,CreateResponse,ErrorResponse> _ENDPOINT
Endpoint "create".
-
-
Method Detail
-
of
public static <TDocument> CreateRequest<TDocument> of(java.util.function.Function<CreateRequest.Builder<TDocument>,ObjectBuilder<CreateRequest<TDocument>>> fn)
-
id
public final java.lang.String id()
Required - Document IDAPI name:
id
-
index
public final java.lang.String index()
Required - The name of the indexAPI name:
index
-
pipeline
@Nullable public final java.lang.String pipeline()
The pipeline id to preprocess incoming documents withAPI name:
pipeline
-
refresh
@Nullable public final Refresh 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
-
routing
@Nullable public final java.lang.String routing()
Specific routing valueAPI name:
routing
-
timeout
@Nullable public final Time timeout()
Explicit operation timeoutAPI name:
timeout
-
version
@Nullable public final java.lang.Long version()
Explicit version number for concurrency controlAPI name:
version
-
versionType
@Nullable public final VersionType versionType()
Specific version typeAPI name:
version_type
-
waitForActiveShards
@Nullable public final WaitForActiveShards 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
public final 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:
serializein interfaceJsonpSerializable
-
createCreateRequestDeserializer
public static <TDocument> JsonpDeserializer<CreateRequest<TDocument>> createCreateRequestDeserializer(JsonpDeserializer<TDocument> tDocumentDeserializer)
-
-