1:java语句
searchSourceBuilder.aggregation(AggregationBuilders.dateHistogram("sourceTime").field("sourceTime")
.fixedInterval(new DateHistogramInterval(groupByData)).minDocCount(0)
.subAggregation(AggregationBuilders.terms("affections").field("affections")));
ParsedDateHistogram agg = response.getAggregations().get("sourceTime");
对应的聚合结果
聚合 | 对应的结果 |
---|---|
AggregationBuilders.dateHistogram | ParsedDateHistogram |