OpenSearch/docs/reference/mapping
Adrien Grand cb868d2f5e
Introduce a `constant_keyword` field. (#49713) (#53024)
This field is a specialization of the `keyword` field for the case when all
documents have the same value. It typically performs more efficiently than
keywords at query time by figuring out whether all or none of the documents
match at rewrite time, like `term` queries on `_index`.

The name is up for discussion. I liked including `keyword` in it, so that we
still have room for a `singleton_numeric` in the future. However I'm unsure
whether to call it `singleton`, `constant` or something else, any opinions?

For this field there is a choice between
 1. accepting values in `_source` when they are equal to the value configured
    in mappings, but rejecting mapping updates
 2. rejecting values in `_source` but then allowing updates to the value that
    is configured in the mapping
This commit implements option 1, so that it is possible to reindex from/to an
index that has the field mapped as a keyword with no changes to the source.

Backport of #49713
2020-03-03 16:01:47 +01:00
..
dynamic Add validation for dynamic templates (#52890) 2020-02-28 10:35:04 +01:00
fields [Docs] Fix syntax error leading to wrong doc ID (#48554) 2019-10-29 10:27:23 +01:00
params [DOCS] Correct guidance for `index_options` mapping parm (#52899) 2020-03-02 07:39:35 -05:00
types Introduce a `constant_keyword` field. (#49713) (#53024) 2020-03-03 16:01:47 +01:00
dynamic-mapping.asciidoc [DOCS] Change // CONSOLE comments to [source,console] (#46441) (#46451) 2019-09-06 11:31:13 -04:00
fields.asciidoc Fix docs of the `_ignored` meta field. 2018-05-02 11:43:50 +02:00
params.asciidoc Add per-field metadata. (#50333) 2020-01-08 16:21:18 +01:00
removal_of_types.asciidoc Stricter checks of setup and teardown in docs tests (#51430) 2020-01-28 16:52:23 +01:00
types.asciidoc Introduce a `constant_keyword` field. (#49713) (#53024) 2020-03-03 16:01:47 +01:00