/ Schema,
/ Update,
/ PerformanceIn-place columns for hot counters and flags
#
Fields that change constantly — view counters, stock levels, feature
flags, ranking scores — used to pay a full document rebuild on every
partial update. Marking a numeric or boolean field with
"inplace": true gives it a dedicated typed column instead:
PUT /my-collection
{
"properties": {
"title": { "type": "keyword" },
"views": { "type": "integer", "inplace": true },
"score": { "type": "double", "inplace": true },
"active": { "type": "boolean", "inplace": true }
}
}
Partial updates on such fields become O(1) column writes — no fetch,
merge, and re-index of the document. Atomic-style operators work
directly against the column:
.../ Update,
/ Schema,
/ CollectionUpdate collection schema
#
Apply an additive schema diff (new or updated field definitions) to an
existing collection. The change is replicated through Raft and every
shard engine of the collection picks it up.
Field deletion is not supported by design — a schema diff can only add or
update properties.
Examples
#
Add a title text field and a non-indexed user.name keyword field to
the collection my-collection:
.../ Update,
/ Settings,
/ CollectionUpdate collection settings
#
Update the collection-level settings of an existing collection. The
change is applied through the Raft-replicated metadata request, so it
survives restarts and reaches every node.
Examples
#
Change the default replica count used for newly allocated rollings:
PUT /my-collection/_settings
{
"rolling": { "number_of_replicas": 2 }
}
Restrict the collection’s shard copies to two nodes:
PUT /my-collection/_settings
{
"routing": {
"allocation": {
"include": { "_id": "node-a,node-b" }
}
}
}
The API returns the following result:
.../ Update,
/ Settings,
/ RollingUpdate rolling settings
#
Adjust the replica count of an existing rolling: every shard group of
the rolling gains new unassigned replica shards (allocated by the shard
allocator when capacity allows) or has its extra replicas removed, and
the rolling’s number_of_replicas setting is updated.
This is the leaf-most level of the
layered settings model —
it overrides the collection-level default for this rolling only.
Examples
#
Scale the rolling 0 of my-collection from 1 to 2 replicas:
.../ Update,
/ Partial,
/ IndexPartial update a document
#
Sometimes we may only need to update a portion of the fields of a document.
A partial update fetches the stored document, merges the partial doc body,
applies the ordered ops operators, and replaces the document in place under
its original _id — the new values are visible to search immediately.
Examples
#
Update the org.id field of the document with system id 0,0 in the
collection my-collection:
...