For AI agents: this page is also available as Markdown at /docs/consistency-and-durability.md. Every docs page is: add .md to its URL. llms.txt lists them all.

Writes, visibility and durability

A write to WarpSearch is accepted first and becomes searchable later, at a commit. Knowing when that happens tells you what a search can see, and how to load and retry data safely.

Accepted, then committed, then searchable

A write goes through two steps. First WarpSearch accepts it: it validates and indexes the documents, and the response tells you how many were indexed and which failed. Then a commit publishes a new, immutable view of the collection. Searches see documents only after the commit that includes them.

You choose how the commit happens:

Option Behavior Use it when
?commit=true on the write (or "commit": true in a {"docs": [...]} body) The request returns only after the commit, so the documents are searchable when you get the response. You must read your own write: a form submit, a test, the last batch of a load.
Omit durability and commit Uses the collection’s default durability and commit interval. Background loads whose visibility requirement matches that policy.
durability=true Wait for a local commit. Search visibility and local persistence.
durability=strong Wait for the commit and its upload to object storage on managed collections. Acknowledged writes must survive loss of the serving node.
POST /v1/collections/{c}/refresh Commits pending writes now. You loaded without commit=true and want to cut over.

The compatible APIs have their own names for this: ?refresh=true (or wait_for) on an Elasticsearch or OpenSearch write and _refresh, and commit=true on a Solr update.

Avoid committing after every small write. Each commit publishes a new view and adds work; see Pricing. For a bulk load, send the batches without commit=true and commit with the last one.

curl -X POST "https://api.warpsearch.io/v1/collections/books/documents?commit=true" \
  -H "Authorization: Bearer $WARPSEARCH_API_KEY" \
  -H "Content-Type: application/json" \
  -d '[{"id": "b1", "title": "Dune", "year": 1965}]'
curl -X PUT "https://api.warpsearch.io/compat/es/books/_doc/b1?refresh=true" \
  -H "Authorization: Bearer $WARPSEARCH_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"title": "Dune", "year": 1965}'
curl -X PUT "https://api.warpsearch.io/compat/opensearch/books/_doc/b1?refresh=true" \
  -H "Authorization: Bearer $WARPSEARCH_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"title": "Dune", "year": 1965}'
curl "https://api.warpsearch.io/compat/solr/books/update?commit=true" \
  -H "Authorization: Bearer $WARPSEARCH_API_KEY" \
  -H "Content-Type: application/json" \
  -d '[{"id": "b1", "title": "Dune", "year": 1965}]'

A document fetched by id (GET /v1/collections/{c}/documents/{id}) follows the same rule: it is visible once committed, not instantly.

A commit is atomic: either the whole new view is published or the previous one stays, so a search never sees half of a commit.

Replace is whole-document

A document is identified by its id. Writing a document with an existing id replaces the old one completely, and fields you leave out of the new version disappear.

# Before: {"id": "b1", "title": "Dune", "year": 1965}
curl -X POST "https://api.warpsearch.io/v1/collections/books/documents?commit=true" \
  -H "Authorization: Bearer $WARPSEARCH_API_KEY" \
  -H "Content-Type: application/json" \
  -d '[{"id": "b1", "title": "Dune"}]'
# After: {"id": "b1", "title": "Dune"}   (year is gone)

String and numeric ids are accepted, and 123 and "123" are the same id. A document with no id can be searched but cannot be replaced or deleted by id, so always send one.

Partial updates are available through native PATCH and Elasticsearch _update, with restrictions on retrievable fields and concurrent writers; see Partial updates. Delete by query remains unsupported; delete documents by id.

Deleting an id that is not there is a successful no-op, so deletes are safe to repeat.

Retrying safely

Because a write with an id replaces the previous version, retrying the same batch leaves one copy of each document. To make a loader safe to retry:

If you pass Solr's overwrite=false on the Solr update endpoint to speed up a load, retries can create duplicates. Leave it off unless every id is new.

Durability

durability=true waits until documents are searchable and saved locally. On managed collections, durability=strong also waits for durable object storage, so a successful response confirms the write will survive loss of the serving node. Omitting the option uses the collection’s default policy. Self-managed installations depend on their storage setup.

Use ?durability=strong on a write URL, or "durability": "strong" in a native write envelope. A refresh can also request strong durability. A 503 durability_unknown means the write was applied but persistence could not be confirmed: repeat full replacements with the same ids, but read back non-idempotent patches before deciding whether to resend them. A 202 commit_running response means the commit is still running; repeat the refresh to wait for completion. Neither response confirms completion of the requested durability level.

Without strong durability, accepted writes can be lost before commit, and locally committed writes can be lost with the node before upload. Background commit and upload timing are configurable. Keep source data so interrupted loads can be replayed.

Collection deletion is permanent. A clone is an independent point-in-time copy, not continuous backup. Collections that retain document sources can also be recovered into a new collection after index damage; stream collections do not retain those sources.

Schema changes do not backfill existing documents. See Changes that are refused.

Reads see one consistent view

A single search request, including its hits, facets and metrics, is computed over one consistent view of the collection, so a facet count never disagrees with the hit total because a commit landed in between. Two separate requests can see different views if a commit lands between them.

Cold starts

The first request to an idle collection can answer 503 warming_up with Retry-After while the collection loads. No data is lost; see Collections.

Quick reference

Question Answer
When is a write searchable? After a completed commit. Use commit=true, durability, or refresh to wait; deferred timing is configurable.
Does a replace merge fields? No. The new document replaces the old one entirely.
Can I update one field? Yes, with partial-update restrictions.
Can I delete by query? No. Delete by id.
Is retrying a write safe? Full replacements with stable ids are safe; increments and appends need read-back checks.
What do I do on 503 warming_up? Retry after Retry-After.
When is a write safe from a node failure? On managed collections, after object-store upload; a successful durability=strong waits for it.

View this page as Markdown

Cookie settings

Optional tracking stays off until you choose it. Your choice applies to this browser for 180 days. Read the details.

Essential storage keeps you signed in, protects forms, and remembers this choice. It is always available.