Class UpdateAction.Builder<TDocument,TPartialDocument>
java.lang.Object
co.elastic.clients.util.ObjectBuilderBase
co.elastic.clients.util.WithJsonObjectBuilderBase<UpdateAction.Builder<TDocument,TPartialDocument>>
co.elastic.clients.elasticsearch.core.bulk.UpdateAction.Builder<TDocument,TPartialDocument>
- All Implemented Interfaces:
WithJson<UpdateAction.Builder<TDocument,
,TPartialDocument>> ObjectBuilder<UpdateAction<TDocument,
TPartialDocument>>
- Enclosing class:
- UpdateAction<TDocument,
TPartialDocument>
public static class UpdateAction.Builder<TDocument,TPartialDocument>
extends WithJsonObjectBuilderBase<UpdateAction.Builder<TDocument,TPartialDocument>>
implements ObjectBuilder<UpdateAction<TDocument,TPartialDocument>>
Builder for
UpdateAction
.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds aUpdateAction
.detectNoop
(Boolean value) If true, theresult
in the response is set to 'noop' when no changes to the document occur.doc
(TPartialDocument value) A partial update to an existing document.docAsUpsert
(Boolean value) Set totrue
to use the contents ofdoc
as the value ofupsert
.The script to run to update the document.The script to run to update the document.scriptedUpsert
(Boolean value) Set totrue
to run the script whether or not the document exists.protected UpdateAction.Builder<TDocument,
TPartialDocument> self()
source
(SourceConfig value) Iffalse
, source retrieval is turned off.Iffalse
, source retrieval is turned off.Serializer for TDocument.Serializer for TPartialDocument.If the document does not already exist, the contents ofupsert
are inserted as a new document.Methods inherited from class co.elastic.clients.util.WithJsonObjectBuilderBase
withJson
Methods inherited from class co.elastic.clients.util.ObjectBuilderBase
_checkSingleUse, _listAdd, _listAddAll, _mapPut, _mapPutAll
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
detectNoop
If true, theresult
in the response is set to 'noop' when no changes to the document occur.API name:
detect_noop
-
doc
A partial update to an existing document.API name:
doc
-
docAsUpsert
Set totrue
to use the contents ofdoc
as the value ofupsert
.API name:
doc_as_upsert
-
script
The script to run to update the document.API name:
script
-
script
public final UpdateAction.Builder<TDocument,TPartialDocument> script(Function<Script.Builder, ObjectBuilder<Script>> fn) The script to run to update the document.API name:
script
-
scriptedUpsert
public final UpdateAction.Builder<TDocument,TPartialDocument> scriptedUpsert(@Nullable Boolean value) Set totrue
to run the script whether or not the document exists.API name:
scripted_upsert
-
source
Iffalse
, source retrieval is turned off. You can also specify a comma-separated list of the fields you want to retrieve.API name:
_source
-
source
public final UpdateAction.Builder<TDocument,TPartialDocument> source(Function<SourceConfig.Builder, ObjectBuilder<SourceConfig>> fn) Iffalse
, source retrieval is turned off. You can also specify a comma-separated list of the fields you want to retrieve.API name:
_source
-
upsert
If the document does not already exist, the contents ofupsert
are inserted as a new document. If the document exists, thescript
is run.API name:
upsert
-
tDocumentSerializer
public final UpdateAction.Builder<TDocument,TPartialDocument> tDocumentSerializer(@Nullable JsonpSerializer<TDocument> value) Serializer for TDocument. If not set, an attempt will be made to find a serializer from the JSON context. -
tPartialDocumentSerializer
public final UpdateAction.Builder<TDocument,TPartialDocument> tPartialDocumentSerializer(@Nullable JsonpSerializer<TPartialDocument> value) Serializer for TPartialDocument. If not set, an attempt will be made to find a serializer from the JSON context. -
self
- Specified by:
self
in classWithJsonObjectBuilderBase<UpdateAction.Builder<TDocument,
TPartialDocument>>
-
build
Builds aUpdateAction
.- Specified by:
build
in interfaceObjectBuilder<TDocument>
- Throws:
NullPointerException
- if some of the required fields are null.
-