Class CreateRequest.Builder<TDocument>
java.lang.Object
co.elastic.clients.util.ObjectBuilderBase
co.elastic.clients.elasticsearch.core.CreateRequest.Builder<TDocument>
- All Implemented Interfaces:
ObjectBuilder<CreateRequest<TDocument>>
- Enclosing class:
- CreateRequest<TDocument>
public static class CreateRequest.Builder<TDocument> extends ObjectBuilderBase implements ObjectBuilder<CreateRequest<TDocument>>
Builder for
CreateRequest
.-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
Modifier and Type Method Description CreateRequest<TDocument>
build()
Builds aCreateRequest
.CreateRequest.Builder<TDocument>
document(TDocument value)
Required - Request body.CreateRequest.Builder<TDocument>
id(java.lang.String value)
Required - Document IDCreateRequest.Builder<TDocument>
index(java.lang.String value)
Required - The name of the indexCreateRequest.Builder<TDocument>
pipeline(java.lang.String value)
The pipeline id to preprocess incoming documents withCreateRequest.Builder<TDocument>
refresh(Refresh value)
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.CreateRequest.Builder<TDocument>
routing(java.lang.String value)
Specific routing valueCreateRequest.Builder<TDocument>
tDocumentSerializer(JsonpSerializer<TDocument> value)
Serializer for TDocument.CreateRequest.Builder<TDocument>
timeout(Time value)
Explicit operation timeoutCreateRequest.Builder<TDocument>
timeout(java.util.function.Function<Time.Builder,ObjectBuilder<Time>> fn)
Explicit operation timeoutCreateRequest.Builder<TDocument>
type(java.lang.String value)
The type of the documentCreateRequest.Builder<TDocument>
version(java.lang.Long value)
Explicit version number for concurrency controlCreateRequest.Builder<TDocument>
versionType(VersionType value)
Specific version typeCreateRequest.Builder<TDocument>
waitForActiveShards(WaitForActiveShards value)
Sets the number of shard copies that must be active before proceeding with the index operation.CreateRequest.Builder<TDocument>
waitForActiveShards(java.util.function.Function<WaitForActiveShards.Builder,ObjectBuilder<WaitForActiveShards>> fn)
Sets the number of shard copies that must be active before proceeding with the index operation.Methods inherited from class co.elastic.clients.util.ObjectBuilderBase
_checkSingleUse, _listAdd, _listAddAll, _mapPut, _mapPutAll
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
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
-
timeout
public final CreateRequest.Builder<TDocument> timeout(java.util.function.Function<Time.Builder,ObjectBuilder<Time>> fn)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
public final CreateRequest.Builder<TDocument> waitForActiveShards(@Nullable WaitForActiveShards value)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
-
waitForActiveShards
public final CreateRequest.Builder<TDocument> waitForActiveShards(java.util.function.Function<WaitForActiveShards.Builder,ObjectBuilder<WaitForActiveShards>> fn)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.API name:
_value_body
-
tDocumentSerializer
public final CreateRequest.Builder<TDocument> tDocumentSerializer(@Nullable JsonpSerializer<TDocument> value)Serializer for TDocument. If not set, an attempt will be made to find a serializer from the JSON context. -
build
Builds aCreateRequest
.- Specified by:
build
in interfaceObjectBuilder<TDocument>
- Throws:
java.lang.NullPointerException
- if some of the required fields are null.
-