From d93e11b302bf341a2c3c4fe578929166e623538f Mon Sep 17 00:00:00 2001 From: Chopper Date: Wed, 4 Aug 2021 16:01:20 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BC=93=E5=AD=98=E5=88=A4=E5=AE=9A=E9=97=AE?= =?UTF-8?q?=E9=A2=98=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/search/serviceimpl/EsGoodsSearchServiceImpl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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());