commit
484e2a2318
@ -1,48 +0,0 @@
|
||||
package cn.lili.elasticsearch;
|
||||
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.data.domain.Sort;
|
||||
|
||||
public class EmptyPage implements Pageable {
|
||||
|
||||
@Override
|
||||
public int getPageNumber() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getPageSize() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getOffset() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Sort getSort() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Pageable next() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Pageable previousOrFirst() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Pageable first() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasPrevious() {
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
@ -7,7 +7,6 @@ import cn.lili.cache.Cache;
|
||||
import cn.lili.cache.CachePrefix;
|
||||
import cn.lili.common.exception.ServiceException;
|
||||
import cn.lili.common.vo.PageVO;
|
||||
import cn.lili.elasticsearch.EmptyPage;
|
||||
import cn.lili.modules.goods.entity.enums.GoodsAuthEnum;
|
||||
import cn.lili.modules.goods.entity.enums.GoodsStatusEnum;
|
||||
import cn.lili.modules.search.entity.dos.EsGoodsIndex;
|
||||
@ -138,8 +137,8 @@ public class EsGoodsSearchServiceImpl implements EsGoodsSearchService {
|
||||
AggregationBuilder sortBuilder = AggregationBuilders.sum("sortAgg").field(ATTR_SORT);
|
||||
AggregationBuilder paramsNameBuilder = AggregationBuilders.terms("nameAgg").field(ATTR_NAME).subAggregation(sortBuilder).order(BucketOrder.aggregation("sortAgg", false)).subAggregation(valuesBuilder);
|
||||
builder.addAggregation(AggregationBuilders.nested("attrAgg", ATTR_PATH).subAggregation(paramsNameBuilder));
|
||||
builder.withPageable(new EmptyPage());
|
||||
NativeSearchQuery searchQuery = builder.build();
|
||||
searchQuery.setMaxResults(0);
|
||||
SearchHits<EsGoodsIndex> search = restTemplate.search(searchQuery, EsGoodsIndex.class);
|
||||
|
||||
log.debug("getSelector DSL:{}", searchQuery.getQuery());
|
||||
|
Loading…
x
Reference in New Issue
Block a user