NativeSearchQueryBuilder nsqb = new NativeSearchQueryBuilder(); DateHistogramAggregationBuilder dhb = AggregationBuilders.dateHistogram("passenger_flow").field("timeString") .dateHistogramInterval(DateHistogramInterval.DAY) .minDocCount(0) .format("yyyy-MM-dd") .extendedBounds(new ExtendedBounds("2023-02-10", "2023-02-16")); nsqb.addAggregation(dhb); //查询对象 SearchQuery queryBuilder = nsqb.build(); Iterable<ExtCallbackStatisticsES> aIterable = extCallbackStatisticsESMapper.search(queryBuilder);
extCallbackStatisticsESMapper.search(queryBuilder);
标签:ElasticsearchRepository,springboot,nsqb,search,queryBuilder,查询,date From: https://www.cnblogs.com/isyysblog/p/17136516.html