-
Notifications
You must be signed in to change notification settings - Fork 25.8k
Formalize dual text/keyword mappings #53181
Copy link
Copy link
Open
Labels
:Search Foundations/MappingIndex mappings, including merging and defining field typesIndex mappings, including merging and defining field types>enhancementTeam:Search FoundationsMeta label for the Search Foundations team in ElasticsearchMeta label for the Search Foundations team in Elasticsearch
Metadata
Metadata
Assignees
Labels
:Search Foundations/MappingIndex mappings, including merging and defining field typesIndex mappings, including merging and defining field types>enhancementTeam:Search FoundationsMeta label for the Search Foundations team in ElasticsearchMeta label for the Search Foundations team in Elasticsearch
Type
Fields
Give feedbackNo fields configured for issues without a type.
Our default dynamic mappings rules create both a text and a keyword field whenever they hit a JSON string:
And over the years, many clients implemented similar logic:
keywordfield,keywordfield,textfield.Is it logic that we should embed in Elasticsearch? Maybe we can find better ideas, but here is a proposal to get the discussion started:
exact_matchquery, which tries to match against the whole string. It fails fortextfields and has the same behavior asmatchonkeyword, numbers, ...text_keywordfield, which is essentially a wrapper around atextand akeywordfield. Running aggregations or anexact_matchquery against this field use the subkeywordfield whilematch,query_string,multi_matchandsimple_query_stringqueries use thetextfield.text+ subkeywordmapping.