-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Automatically add a sub keyword field to string dynamic mappings. #17188
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Automatically add a sub keyword field to string dynamic mappings. #17188
Conversation
|
Is the intention here supposed to be to allow users to use aggregations on any json string "by default"? This means the data would then be indexed 3 times, once in the field, once in _all, and once in the keyword subfield. If I was correct above, then do we really need this subfield to be indexed, or could it just be there for doc values? I'm also more of a fan of "original" then for the name. |
|
Your assumptions are correct. Indexing the sub field is useful so that if the user runs eg. a terms aggregations to build a pie chart, then we can build a filter on the same field when (s)he clicks on one piece of the chart. If we were to do it with the text field, we might also match values that have a different case for instance. I used "keyword" because it was the suggested name on #12394 (see "Good out-of-the-box dynamic mappings for string fields"). |
|
Personally I'm a fan of If we were to use Opinions welcome. |
|
Should we merge it as-is so that this feature would be included in the alpha releases and we have feedback about this multi-field mapping by default? Then we can open a blocker issue about whether we want to change the naming for the GA. |
|
+1 to merge |
…stic#17188 If you add a string field to a document, it will have the following default mapping: ``` { "type": "text", "fields": { "keyword": { "type": "keyword", "ignore_above": 256 } } } ```
82d7de2 to
0eedc78
Compare
The getting started docs use dynamic mappings. With the recent change to string split into text and keyword, text lost the default ability to do aggs. This was added back in elastic#17188. This change updates the getting started examples to use the keyword multi field added to dynamically mapped text fields. closes elastic#17941
|
Do we really want to couple the name of the mult-field to the the analyzer type? keyword analzyer really should be called |
|
@djschny I believe the idea was more to couple it with the field type than the analyzer type. Please open a new issue if you think this should be changed to something else. |
With this commit we correct use `keyword` subfields in all aggregation-related examples in the intro chapter. They are needed since Elasticsearch 5.0 as text-fields do not have fielddata enabled. Relates elastic/elasticsearch#17188
With this commit we correct use `keyword` subfields in all aggregation-related examples in the intro chapter. They are needed since Elasticsearch 5.0 as text-fields do not have fielddata enabled. Relates elastic/elasticsearch#17188
If you add a string field to a document, it will have the following default
mapping: