From 60cf5c92dd502e4f03b6af2cc7be423a93a7d90f Mon Sep 17 00:00:00 2001 From: lifenlong Date: Tue, 3 Aug 2021 17:54:04 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E6=B2=A1=E6=9C=89=E5=85=B3?= =?UTF-8?q?=E9=94=AE=E8=AF=8D=E6=98=BE=E7=A4=BA=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/search/serviceimpl/EsGoodsSearchServiceImpl.java | 3 +++ 1 file changed, 3 insertions(+) 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);