Schema #
A collection’s schema describes its fields: the type of every field, the parameters each field is indexed and stored with, and how fields the schema does not know yet are handled. It is versioned, Raft-replicated, and evolves additively — fields can be added and re-parameterized, never deleted.
{
"version": 3,
"dynamic": "true",
"properties": {
"body": {
"type": "text",
"analyzer": "standard",
"fields": {
"embedding": {
"type": "dense_vector",
"vector_options": { "model": "text-embedding-3-small", "dims": 1536 }
}
}
}
}
}
Three knobs live at the schema root:
version— incremented on every applied change; read-only.dynamic— how writes with unknown fields are handled:true(default): new fields are added to the schema automatically. A JSON string inferstextwith akeywordsub-field; numbers, booleans and objects infer their natural type.false: unknown fields are neither indexed nor added — they still appear in_source.strict: documents with unknown fields are rejected.
properties— the field tree. Nested objects useproperties("user": {"type": "object", "properties": {...}}); same-field variants use multi-fields (fields), which is also how the declarative semantic embedding above works — see vector search.
In this section #
- Field types — every supported type, grouped by family, with its parameters and multi-value support.
- Field parameters — the cross-type parameter catalog, grouped by category: analysis, indexing, storage placement, realtime and in-place, structural, type-specific.
Managing schemas #
- Declare the initial schema in Create a collection.
- Evolve it with the additive diff API: Update collection schema.
- Read it back: Get collection schema or the ES-compatible Get mapping.