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 5a7217b7..2ad41f23 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 @@ -104,6 +104,9 @@ public class EsGoodsSearchServiceImpl implements EsGoodsSearchService { @Override public List getHotWords(Integer count) { List hotWords = new ArrayList<>(); + if (hotWords.isEmpty() || hotWords == null) { + return null; + } //下表从0开始,所以count-1 count = count - 1; Set set = cache.reverseRangeWithScores(CachePrefix.HOT_WORD.getPrefix(), count);