diff --git a/framework/src/main/java/cn/lili/modules/search/serviceimpl/EsGoodsSearchServiceImpl.java b/framework/src/main/java/cn/lili/modules/search/serviceimpl/EsGoodsSearchServiceImpl.java index fd917a99..a4aea352 100644 --- a/framework/src/main/java/cn/lili/modules/search/serviceimpl/EsGoodsSearchServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/search/serviceimpl/EsGoodsSearchServiceImpl.java @@ -107,8 +107,8 @@ public class EsGoodsSearchServiceImpl implements EsGoodsSearchService { // redis 排序中,下标从0开始,所以这里需要 -1 处理 count = count - 1; Set set = cache.reverseRangeWithScores(CachePrefix.HOT_WORD.getPrefix(), count); - if (set.isEmpty() || set == null) { - return null; + if (set == null || set.isEmpty()) { + return new ArrayList(); } for (DefaultTypedTuple defaultTypedTuple : set) { hotWords.add(Objects.requireNonNull(defaultTypedTuple.getValue()).toString());