I have an index with a field, F, that has the following mapping:
"mapping": {
"type": "double",
"doc_values": True,
"index": False
}
Just as written in the ES guide, this should improve the performance of aggregation queries (like computing the average over the values of this field in some subset of the documents).
However, while I can perform aggregation queries by hand (e.g. in the Dev Tools console), I am unable to make plot F as a metric on the Y-axis in a Kibana visualization (like having a date histogram on a timestamp as the x-axis, and the average value of F per date bucket on the y-axis). Kibana complains that "No Compatible Fields: The "trades-*" index pattern does not contain any of the following field types: number".
Going to Management > Index Patterns, i see that the "trades-*" index has F as type number, but it does not have a check mark for "aggregatable". This seems internally consistent with Kibana's inability to visualize F as an aggregated metric. Yet, it makes no sense to me why Kibana claims it cannot aggregate over F, when I can in fact perform an aggregation query on it by hand.
the query:
GET /trades-*/_search
{
"size": 0,
"aggs": {
"test": {
"avg": {
"field": "F"
}
}
}
}
the result:
{
"took": 5,
"timed_out": false,
"_shards": {
"total": 53,
"successful": 53,
"failed": 0
},
"hits": {
"total": 334629,
"max_score": 0,
"hits": []
},
"aggregations": {
"test": {
"value": 5123.30
}
}
}
So, the question in the topic header: Why is Kibana unable to aggregate non-indexed fields that have doc_values=True?
Edit: I should add that I'm running Kibana 5.0.0 and Elasticsearch 5.0.0