Class UpdateRequest<TDocument,TPartialDocument>
java.lang.Object
co.elastic.clients.elasticsearch._types.RequestBase
co.elastic.clients.elasticsearch.core.UpdateRequest<TDocument,TPartialDocument>
- All Implemented Interfaces:
JsonpSerializable
@JsonpDeserializable
public class UpdateRequest<TDocument,TPartialDocument>
extends RequestBase
implements JsonpSerializable
Updates a document with a script or partial document.
- 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<UpdateRequest<Object,Object>> Json deserializer forUpdateRequestbased on named deserializers provided by the callingJsonMapper.static final SimpleEndpoint<UpdateRequest<?,?>, ?> Endpoint "update". -
Method Summary
Modifier and TypeMethodDescriptionstatic <TDocument>
Endpoint<UpdateRequest<?,?>, UpdateResponse<TDocument>, ErrorResponse> createUpdateEndpoint(JsonpDeserializer<TDocument> tDocumentDeserializer) Create an "update" endpoint.static <TDocument,TPartialDocument>
JsonpDeserializer<UpdateRequest<TDocument,TPartialDocument>> createUpdateRequestDeserializer(JsonpDeserializer<TDocument> tDocumentDeserializer, JsonpDeserializer<TPartialDocument> tPartialDocumentDeserializer) Create a JSON deserializer for UpdateRequestfinal BooleanSet to false to disable setting 'result' in the response to 'noop' if no change to the document occurred.final TPartialDocumentdoc()A partial update to an existing document.final BooleanSet to true to use the contents of 'doc' as the value of 'upsert'final Stringid()Required - Document IDfinal LongOnly perform the operation if the document has this primary term.final LongifSeqNo()Only perform the operation if the document has this sequence number.final Stringindex()Required - The name of the indexfinal Stringlang()The script language.static <TDocument,TPartialDocument>
UpdateRequest<TDocument,TPartialDocument> of(Function<UpdateRequest.Builder<TDocument, TPartialDocument>, ObjectBuilder<UpdateRequest<TDocument, TPartialDocument>>> fn) final Refreshrefresh()If 'true', Elasticsearch refreshes the affected shards to make this operation visible to search, if 'wait_for' then wait for a refresh to make this operation visible to search, if 'false' do nothing with refreshes.final BooleanIf true, the destination must be an index alias.final IntegerSpecify how many times should the operation be retried when a conflict occurs.final Stringrouting()Custom value used to route operations to a specific shard.final Scriptscript()Script to execute to update the document.final BooleanSet to true to execute the script whether or not the document exists.voidserialize(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper) Serialize this object to JSON.protected voidserializeInternal(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper) protected static <TDocument,TPartialDocument>
voidsetupUpdateRequestDeserializer(ObjectDeserializer<UpdateRequest.Builder<TDocument, TPartialDocument>> op, JsonpDeserializer<TDocument> tDocumentDeserializer, JsonpDeserializer<TPartialDocument> tPartialDocumentDeserializer) final SourceConfigsource()Set to false to disable source retrieval.final Timetimeout()Period to wait for dynamic mapping updates and active shards.final Stringtype()The type of the documentfinal TDocumentupsert()If the document does not already exist, the contents of 'upsert' are inserted as a new document.final WaitForActiveShardsThe number of shard copies that must be active before proceeding with the operations.Methods inherited from class co.elastic.clients.elasticsearch._types.RequestBase
toString
-
Field Details
-
_DESERIALIZER
Json deserializer forUpdateRequestbased on named deserializers provided by the callingJsonMapper. -
_ENDPOINT
Endpoint "update".
-
-
Method Details
-
of
public static <TDocument,TPartialDocument> UpdateRequest<TDocument,TPartialDocument> of(Function<UpdateRequest.Builder<TDocument, TPartialDocument>, ObjectBuilder<UpdateRequest<TDocument, TPartialDocument>>> fn) -
source
Set to false to disable source retrieval. You can also specify a comma-separated list of the fields you want to retrieve.API name:
_source -
detectNoop
Set to false to disable setting 'result' in the response to 'noop' if no change to the document occurred.API name:
detect_noop -
doc
A partial update to an existing document.API name:
doc -
docAsUpsert
Set to true to use the contents of 'doc' as the value of 'upsert'API name:
doc_as_upsert -
id
Required - Document IDAPI name:
id -
ifPrimaryTerm
Only perform the operation if the document has this primary term.API name:
if_primary_term -
ifSeqNo
Only perform the operation if the document has this sequence number.API name:
if_seq_no -
index
Required - The name of the indexAPI name:
index -
lang
The script language.API name:
lang -
refresh
If 'true', Elasticsearch refreshes the affected shards to make this operation visible to search, if 'wait_for' then wait for a refresh to make this operation visible to search, if 'false' do nothing with refreshes.API name:
refresh -
requireAlias
If true, the destination must be an index alias.API name:
require_alias -
retryOnConflict
Specify how many times should the operation be retried when a conflict occurs.API name:
retry_on_conflict -
routing
Custom value used to route operations to a specific shard.API name:
routing -
script
Script to execute to update the document.API name:
script -
scriptedUpsert
Set to true to execute the script whether or not the document exists.API name:
scripted_upsert -
timeout
Period to wait for dynamic mapping updates and active shards. This guarantees Elasticsearch waits for at least the timeout before failing. The actual wait time could be longer, particularly when multiple waits occur.API name:
timeout -
type
The type of the documentAPI name:
type -
upsert
If the document does not already exist, the contents of 'upsert' are inserted as a new document. If the document exists, the 'script' is executed.API name:
upsert -
waitForActiveShards
The number of shard copies that must be active before proceeding with the operations. Set to 'all' or any positive integer up to the total number of shards in the index (number_of_replicas+1). Defaults to 1 meaning the primary shard.API name:
wait_for_active_shards -
serialize
Serialize this object to JSON.- Specified by:
serializein interfaceJsonpSerializable
-
serializeInternal
-
createUpdateRequestDeserializer
public static <TDocument,TPartialDocument> JsonpDeserializer<UpdateRequest<TDocument,TPartialDocument>> createUpdateRequestDeserializer(JsonpDeserializer<TDocument> tDocumentDeserializer, JsonpDeserializer<TPartialDocument> tPartialDocumentDeserializer) Create a JSON deserializer for UpdateRequest -
setupUpdateRequestDeserializer
protected static <TDocument,TPartialDocument> void setupUpdateRequestDeserializer(ObjectDeserializer<UpdateRequest.Builder<TDocument, TPartialDocument>> op, JsonpDeserializer<TDocument> tDocumentDeserializer, JsonpDeserializer<TPartialDocument> tPartialDocumentDeserializer) -
createUpdateEndpoint
public static <TDocument> Endpoint<UpdateRequest<?,?>, createUpdateEndpointUpdateResponse<TDocument>, ErrorResponse> (JsonpDeserializer<TDocument> tDocumentDeserializer) Create an "update" endpoint.
-