Represents an update step in a Snap.Bulk operation.
Updates an existing document, returning an error if it does not exist, unless an upsert is configured.
Supports the following action fields:
index- the index to write to, if not specified on the bulk operationid- the document ID to updaterequire_alias- whentrue, the destination must be an index aliasrouting- the custom routing value for the documentif_seq_no- only perform the action if the document has this sequence numberif_primary_term- only perform the action if the document has this primary termretry_on_conflict- how many times to retry the update if a version conflict occurspipeline- the ingest pipeline to run an upserted document throughsource- which parts of the updated_sourceto return
Note that updates do not support version/version_type. Use if_seq_no
and if_primary_term instead.
Along with the following document fields:
doc- the partial document to merge into the existing onedoc_as_upsert- whentrue,docis indexed if the document does not already existscript- a script to run against the existing document, instead ofdocupsert- the document to index if it does not already existscripted_upsert- whentrue,scriptis run againstupsertwhen the document does not already existdetect_noop- whenfalse, the document is always reindexed, even ifdocmakes no changes to it
Summary
Types
@type t() :: %Snap.Bulk.Action.Update{ detect_noop: boolean() | nil, doc: map() | nil, doc_as_upsert: boolean() | nil, id: String.t() | nil, if_primary_term: integer() | nil, if_seq_no: integer() | nil, index: String.t() | nil, pipeline: String.t() | nil, require_alias: boolean() | nil, retry_on_conflict: integer() | nil, routing: String.t() | nil, script: map() | nil, scripted_upsert: boolean() | nil, source: Snap.Bulk.Action.source() | nil, upsert: map() | nil }