Closed
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