Description
It would sometimes be useful for ingestion tools to be able to associate metadata with fields that could later be leveraged by visualization tools such as Kibana to provide a better out-of-the-box experience. One example that got mentioned a number of times for instance is the ability to know the unit of a field. One way to do it would be by giving Elasticsearch the ability to associate metadata per field in the mappings, something like this:
{
"mappings": {
"_doc": {
"properties": {
"response_time": {
"type": "float",
"_meta": {
"unit": "s"
}
},
"response_size": {
"type": "long",
"_meta": {
"unit": "b"
}
}
}
}
}
}
This metadata wouldn't be validated by Elasticsearch: any key-value pairs would be accepted, so there would need to be conventions on key names and values.
Even though things like units are not expected to change on an existing index, preventing updates seems a bit too restrictive since it would be a pity to require reindexing for something that doesn't affect the way that data is indexed. So I propose that updates are merged with existing _meta
and that null
values may be used to remove existing keys.
Known limitation: For users that already have lots of fields and/or indices, using this feature extensively won't be recommended as it will further increase the size of the cluster state.