如何使用Sum Bucket Aggregation api


(Neiltw) #1

大家好 ,請問一下如何使用Sum Bucket Aggregation java api 網路上都沒有example code thanks


(Wanglifengwf) #2

you can do like this:

client.prepareSearch("index")
          .addAggregation(AggregationBuilders
                                        .sum("sum_name")
                                        .field("field_name"));

(system) #3