-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Closed
Labels
:Search Foundations/MappingIndex mappings, including merging and defining field typesIndex mappings, including merging and defining field types>featureTeam:Search FoundationsMeta label for the Search Foundations team in ElasticsearchMeta label for the Search Foundations team in Elasticsearch
Description
It is hard to rename a field when using time-based indices - search and especially aggregations will only work on either the new or the old version, but there is a transition period where not all data will be seen.
We can introduce a new field type called alias which simply points to another field, eg:
PUT my_index
{
"mappings": {
"my_type": {
"properties": {
"host": {
"properties": {
"source_ip": {
"type": "ip"
}
}
},
"sourceIP": {
"type": "alias",
"path": "host.source_ip"
}
}
}
}
}
This field type would work as follows:
- Attempts to index into the alias field would result in an exception - it is read only
- Queries, aggs, suggestions, scripts (using
doc[]), highlighting, fielddata_fields, docvalue_fields, stored_fields would just get the data (and mapping) from the specified path - Source filtering would not work with the aliased field
This also works for users who want to expose a nicer name for fields in Kibana
dadoonet, gmoskovicz, ppf2, tarunramsinghani, cdahlqvist and 15 more
Metadata
Metadata
Assignees
Labels
:Search Foundations/MappingIndex mappings, including merging and defining field typesIndex mappings, including merging and defining field types>featureTeam:Search FoundationsMeta label for the Search Foundations team in ElasticsearchMeta label for the Search Foundations team in Elasticsearch