Lesson 6 — Operations #
Keeping a node healthy: partial updates in place, compaction, the change feed, and reading cluster state. This lesson is server-side — start a node as in Lesson 1 and run the curls against it.
Partial updates in place #
The document update API takes doc (merge), ops (arithmetic), or both:
curl -X POST -H "Authorization: Bearer $KEY" \
-H 'Content-Type: application/json' \
-d '{
"ops": [
{ "op": "incr", "field": "qty", "value": -1 },
{ "op": "min", "field": "price", "value": 9.9 }
]
}' \
http://localhost:28000/sales/_update/<doc_id>
Eleven operators — set, unset, incr, mul, min, max, toggle, append, add_to_set, rename, current_date — each a column-level write, not a
read-modify-write of the whole document. Fields mapped with "inplace": true apply as O(1) column writes; the full semantics (visibility,
arithmetic, mixed updates) are in the
partial update reference and
in-place columns.
No refresh follows: search sees the new values on the next request.
Compaction #
Realtime writes land in a mutable layer; background epochs freeze and merge them. When you want that on demand — after a bulk import, before a benchmark:
curl -X POST -H "Authorization: Bearer $KEY" \
http://localhost:28000/sales/_compact
The compaction reference covers the response fields; node-level compaction controls live in node settings (pause, tick interval, concurrency).
The change feed #
Consume writes as they happen with GET /{collection}/_changes — the
cursor format and consumption loop are in the
change feed reference:
curl -H "Authorization: Bearer $KEY" \
'http://localhost:28000/sales/_changes?limit=10'
Reading the cluster #
GET /_cluster/health?level=shards— one glance, every level from cluster to shard ( health reference).GET /_cluster/state— the catalog view; filter with/_cluster/state/collections,shards.GET /_node/_local/stats— per-node counters; the full endpoint map is in node observability.GET /_node/_local/settings— dynamic settings, changeable at runtime ( node settings), including the live log level.
Where to go from here #
- The full search reference, one page per query type, every parameter.
- Deployment for systemd, NUMA and multi-node joins.
- The playground to keep experimenting in the browser.