1:java语句

    1. searchSourceBuilder.aggregation(AggregationBuilders.dateHistogram("sourceTime").field("sourceTime")
    2. .fixedInterval(new DateHistogramInterval(groupByData)).minDocCount(0)
    3. .subAggregation(AggregationBuilders.terms("affections").field("affections")));
    4. ParsedDateHistogram agg = response.getAggregations().get("sourceTime");

    对应的聚合结果

    聚合 对应的结果
    AggregationBuilders.dateHistogram ParsedDateHistogram