capabilities.work

Document Lifecycle

A 4-step recipe with Elasticsearch. We can help you get access.

Recipe · 4 steps

Document Lifecycle

Index, read, partially update, and re-read a single document by id.

  1. Index the document at the supplied id. Elasticsearch answers 201 when the document is new and 200 when it replaced an existing document at that id, so both are accepted.
  2. Read the document straight back to confirm exactly what was persisted before any update is attempted.
  3. Merge the partial document into the stored source. Fields not named in the partial update are left untouched.
  4. Read the document a second time to confirm the merge landed and to capture the version Elasticsearch incremented to.
What you'll need to have ready
  • index: The index to write the document into.
  • id: The caller-controlled document id.
  • document: The full document source to index.
  • partialUpdate: The partial document to merge into the existing source.
For your developer

Arazzo workflow elasticsearch:document-lifecycle, 4 operations: indexDocument → getDocument → updateDocument → getDocument. Specs on APIs.io.