= productBhv.selectPage(cb -> { cb.query().matchAll(); cb.aggregation().setRegularPrice_Range(op -> { op.addUnboundedFrom("all", 0) .addRange("average", 1000, 5000) .addUnboundedTo("cheap", 1000); }, aggs -> {}); cb.query().addOrderBy_ProductHandleCode_Asc(); cb.paging(5, 1); }); EsPagingResultBean<Product> list2 = (EsPagingResultBean<Product>) list1; Aggregations aggregations = list2.getAggregations(); Range range = (Range) aggregations.get("regular_price"); assertEquals(4, range.getBuckets().get(0).getDocCount()); 69