聚合:"aggs": {
"cid": {
"terms": {
"field": "jsonData.cid",
"size": 2000
},
"aggs": {
"acc": {
"terms": {
"field": "jsonData.acc.keyword",
"size": 20000
},
"aggs": {
"max": {
"max": {
"field": "jsonData.hisNum"
}
},"min": {
"min": {
"field": "jsonData.hisNum"
}
},
"minus": {
"bucket_script": {
"buckets_path": {
"max": "max",
"min":"min"
},
"script": "params.max-params.min"
}
}
}
}
}
},"total":{
"sum_bucket": {
"buckets_path": "cid>acc>minus"
}
}
}
异常:
{
"error": {
"root_cause": [],
"type": "search_phase_execution_exception",
"reason": "",
"phase": "fetch",
"grouped": true,
"failed_shards": [],
"caused_by": {
"type": "aggregation_execution_exception",
"reason": "buckets_path must reference either a number value or a single value numeric metric aggregation, got: java.lang.Object[]"
}
},
"status": 503
}
"cid": {
"terms": {
"field": "jsonData.cid",
"size": 2000
},
"aggs": {
"acc": {
"terms": {
"field": "jsonData.acc.keyword",
"size": 20000
},
"aggs": {
"max": {
"max": {
"field": "jsonData.hisNum"
}
},"min": {
"min": {
"field": "jsonData.hisNum"
}
},
"minus": {
"bucket_script": {
"buckets_path": {
"max": "max",
"min":"min"
},
"script": "params.max-params.min"
}
}
}
}
}
},"total":{
"sum_bucket": {
"buckets_path": "cid>acc>minus"
}
}
}
异常:
{
"error": {
"root_cause": [],
"type": "search_phase_execution_exception",
"reason": "",
"phase": "fetch",
"grouped": true,
"failed_shards": [],
"caused_by": {
"type": "aggregation_execution_exception",
"reason": "buckets_path must reference either a number value or a single value numeric metric aggregation, got: java.lang.Object[]"
}
},
"status": 503
}
1 个回复
zhyusElastic - 90后IT java
赞同来自: