NestedSortBuilder nestedSort = new NestedSortBuilder("tenantIdList"); nestedSort.setFilter(QueryBuilders.nestedQuery( StringUtils.camelToUnderline("tenantIdList.lastTime"), QueryBuilders.rangeQuery("tenantIdList.lastTime"), ScoreMode.Avg )); SortBuilder<?> sortBuilderOrder = SortBuilders.fieldSort("tenantIdList.lastTime") .order( SortOrder.DESC).setNestedSort(nestedSort); esQueryWrapper.sort(sortBuilderOrder);
标签:排序,tenantIdList,嵌套,nestedSort,lastTime,QueryBuilders,es,sortBuilderOrder From: https://www.cnblogs.com/zhangrongfei/p/17202276.html