hi, there is an error occured when i try to use "sum_bucket" aggregation. Query body is like:
get /index/type/_search
{
"query":{
"bool":{
"filter":[
{
"range":{
"time":{
"gte":1531365921000,
"lte":1531365931000
}
}
}
],
"must":[
{
"match":{
"key":"value"
}
}
]
}
},
"aggs":{
"vals":{
"terms":{
"field":"field1",
"size":1000
},
"aggs":{
"field2":{
"sum_bucket":{
"buckets_path":"vals>field2"
}
},
"vals":{
"aggs":{
"field2":{
"avg":{
"field":"field2"
}
}
},
"terms":{
"field":"field3"
}
}
}
}
},
"size":0
}
but i get an error response:
'{"error":{"root_cause":[],"type":"search_phase_execution_exception","reason":"","phase":"fetch","grouped":true,"failed_shards":[],"caused_by":{"type":"class_cast_exception","reason":"org.elasticsearch.search.aggregations.pipeline.InternalSimpleValue cannot be cast to org.elasticsearch.search.aggregations.InternalMultiBucketAggregation"}},"status":503}
The version of es is 6.1.3, platform centos6.5.
Can Someone tell me what happened? Thanks!