How do I refer to "avg_flight_min" in the Range Aggregation, replacing the hard-coded value of 100:
GET kibana_sample_data_flights/_search
{
"size": 0,
"aggs": {
"avg_flight_min": {
"avg": {
"field": "FlightTimeMin"
}
},
"price_ranges": {
"range": {
"field": "FlightTimeMin",
"keyed": true,
"ranges": [
{
"key": "below_avg",
"to": 100
},
{
"key": "above_avg",
"from": 100
}
]
}
}
}
}
I am using the Sample Flight Data in this example.