Class UpdateAction<TDocument,TPartialDocument>

java.lang.Object
co.elastic.clients.elasticsearch.core.bulk.UpdateAction<TDocument,TPartialDocument>
All Implemented Interfaces:
JsonpSerializable

@JsonpDeserializable public class UpdateAction<TDocument,TPartialDocument> extends Object implements JsonpSerializable
The source line that must follow an update action line. It specifies the partial document, script, or upsert options to apply, plus optional update settings.
See Also:
  • Field Details

  • Method Details

    • of

      public static <TDocument, TPartialDocument> UpdateAction<TDocument,TPartialDocument> of(Function<UpdateAction.Builder<TDocument,TPartialDocument>,ObjectBuilder<UpdateAction<TDocument,TPartialDocument>>> fn)
    • detectNoop

      @Nullable public final Boolean detectNoop()
      If true, the result in the response is set to 'noop' when no changes to the document occur.

      API name: detect_noop

    • doc

      @Nullable public final TPartialDocument doc()
      A partial update to an existing document.

      API name: doc

    • docAsUpsert

      @Nullable public final Boolean docAsUpsert()
      Set to true to use the contents of doc as the value of upsert.

      API name: doc_as_upsert

    • script

      @Nullable public final Script script()
      The script to run to update the document.

      API name: script

    • scriptedUpsert

      @Nullable public final Boolean scriptedUpsert()
      Set to true to run the script whether or not the document exists.

      API name: scripted_upsert

    • source

      @Nullable public final SourceConfig source()
      If false, source retrieval is turned off. You can also specify a comma-separated list of the fields you want to retrieve.

      API name: _source

    • upsert

      @Nullable public final TDocument 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 run.

      API name: upsert

    • serialize

      public void serialize(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper)
      Serialize this object to JSON.
      Specified by:
      serialize in interface JsonpSerializable
    • serializeInternal

      protected void serializeInternal(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper)
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • rebuild

      public UpdateAction.Builder rebuild()
      Returns:
      New UpdateAction.Builder initialized with field values of this instance
    • createUpdateActionDeserializer

      public static <TDocument, TPartialDocument> JsonpDeserializer<UpdateAction<TDocument,TPartialDocument>> createUpdateActionDeserializer(JsonpDeserializer<TDocument> tDocumentDeserializer, JsonpDeserializer<TPartialDocument> tPartialDocumentDeserializer)
      Create a JSON deserializer for UpdateAction
    • setupUpdateActionDeserializer

      protected static <TDocument, TPartialDocument> void setupUpdateActionDeserializer(ObjectDeserializer<UpdateAction.Builder<TDocument,TPartialDocument>> op, JsonpDeserializer<TDocument> tDocumentDeserializer, JsonpDeserializer<TPartialDocument> tPartialDocumentDeserializer)