Introduce a constant_keyword
field. (#49713)
#53024
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This field is a specialization of the
keyword
field for the case when alldocuments 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 westill have room for a
singleton_numeric
in the future. However I'm unsurewhether to call it
singleton
,constant
or something else, any opinions?For this field there is a choice between
_source
when they are equal to the value configuredin mappings, but rejecting mapping updates
_source
but then allowing updates to the value thatis 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