Hello, I'm trying to plot the results of a custom scripted aggregation, such as the following (based on flight data from https://demo.elastic.co)
The aggregation returns the number of flights with the same weather in Origin and Destination:
GET flights/_search
{
"size": 0,
"_source": {
"excludes": []
},
"aggs": {
"whatever": {
"composite": {
"sources": [
{
"2": {
"terms": {
"script": {
"source": "if (doc['DestWeather.keyword'] == doc['OriginWeather.keyword']) return doc['DestWeather.keyword']; ",
"lang": "painless"
}
}
}
}
]
}
}
},
"query": {
"match_all": {}
}
}
and has been suggested in this elastic thread.
Another way to put it: only show the diagonal of this Heatmap:
I tried to use the above script in the 'JSON input' field of DestWeather aggregation, but only raised a variety of errors.
Am I correct this is the correct kibana thread to follow, or the question already has a solution?