Elasticsearch · Arazzo Workflow
Elasticsearch Upsert a Document by Business Key
Version 1.0.0
Search an index for a document matching a business key and update it if found, otherwise index a new one.
Provider
Workflows
upsert-document
Upsert a document into an index keyed on a business field rather than the internal document id.
Resolves an existing document by a term query on the key field, then updates the matched document or indexes a new one when nothing matched.
1
findExisting
searchDsl
Run a term query on the key field, asking for at most one hit. A zero-hit response is a valid answer here and drives the create branch.
2
updateMatched
updateDocument
Merge the payload into the document that matched the business key. Fields absent from the payload are preserved.
3
indexNew
indexDocument
Index a new document at the supplied id when no existing document carried the business key.