{
"size":0,
"aggs" : {
"avg_speed" : {"max" : {"field" : "Speed" } }
}
}
{
"query": {
"bool": {
"must": [
{
"range":{
"Speed":{
"gte":{"avg_speed"}
}
}
}
]
}
}
Can i club above two queries? I want to use avg_speed computed in first query in the next range query, is their any functionality like this?
Problem domain is: I want to compute documents that have speed range greater then average speed