You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The doc_values field in index mappings can now be specified as an object with a nullability sub-parameter (in addition to the existing plain-boolean form):
When nullability: false, every document must supply a non-null value for the field; omission, explicit null, empty arrays, or all-null arrays are all rejected at index time with a parse error.
The nullability field defaults to true (no-op, matches current behavior).
New index-level setting
index.mapping.doc_values.nullability: false makes every field in the index required unless a specific field overrides it with doc_values: { "nullability": true }.
There is already an open spec PR #6391 that introduces a DocValuesConfig union type to cover doc_values.multi_value (from elasticsearch#148454). That PR changes doc_values from boolean to boolean | DocValuesConfig.
This PR (nullability) adds a second sub-parameter to the same DocValuesConfig object. The two changes should be coordinated: whichever lands first sets the structure, and the second adds to it. It may be simplest to handle them in a single pass.
The PR has the test-release label, suggesting nullability may have been behind a feature flag previously. Verify whether an @availability annotation (e.g. since=9.5.0) or a feature-flag guard is needed.
Consider assigning the original ES PR author @Kubik42.
Summary
Elasticsearch PR #152361 — "Added nullability doc_values mapping parameter" — adds a
nullabilityboolean sub-parameter to thedoc_valuesmapping object and a corresponding index-level settingindex.mapping.doc_values.nullability.@Kubik42b362d0d0faf7cd3d4c86099fb3fe992c0dec7b43v9.5.0main(backport to9.5once released)API impact
doc_valuesmapping parameter extendedThe
doc_valuesfield in index mappings can now be specified as an object with anullabilitysub-parameter (in addition to the existing plain-boolean form):{ "properties": { "host": { "type": "keyword", "doc_values": { "nullability": false } } } }When
nullability: false, every document must supply a non-null value for the field; omission, explicitnull, empty arrays, or all-null arrays are all rejected at index time with a parse error.The
nullabilityfield defaults totrue(no-op, matches current behavior).New index-level setting
index.mapping.doc_values.nullability: falsemakes every field in the index required unless a specific field overrides it withdoc_values: { "nullability": true }.Relationship to open PR #6391
There is already an open spec PR #6391 that introduces a
DocValuesConfigunion type to coverdoc_values.multi_value(from elasticsearch#148454). That PR changesdoc_valuesfrombooleantoboolean | DocValuesConfig.This PR (nullability) adds a second sub-parameter to the same
DocValuesConfigobject. The two changes should be coordinated: whichever lands first sets the structure, and the second adds to it. It may be simplest to handle them in a single pass.Specification files to edit
specification/_types/mapping/core.ts—doc_values?: booleanneeds to becomedoc_values?: boolean | DocValuesConfig(orDocValuesConfigextended if PR Add doc_values.multi_value config for mapping properties #6391 has already landed).specification/_types/mapping/complex.ts— same change ascore.ts.specification/_types/mapping/(new or existing type file) — define or extendDocValuesConfigto includenullability?: booleanalongside themulti_valuefield from PR Add doc_values.multi_value config for mapping properties #6391.Notes / questions for the triager
DocValuesConfigformulti_value. Both changes affect the same type; merging them avoids churn.test-releaselabel, suggestingnullabilitymay have been behind a feature flag previously. Verify whether an@availabilityannotation (e.g.since=9.5.0) or a feature-flag guard is needed.@Kubik42.