GET /gunspoc/_search { "query": { "match": { "name": "姓名" } }, "aggs": { "fenzu": { "terms": { "field": "age" }, "aggs": { "having":{ "bucket_selector": { "buckets_path": { "aggrs": "_count" }, "script": { "source": "params.aggrs > 0" } } } } } } }
GET /gunspoc/_search { "query": { "match": { "name": "姓名" } }, "aggs": { "fenzu": { "terms": { "field": "age" }, "aggs": { "having":{ "bucket_selector": { "buckets_path": { "aggrs": "_count" }, "script": { "source": "params.aggrs > 0" } } } } } } }