解决没有关键词显示错误

This commit is contained in:
lifenlong 2021-08-03 17:54:04 +08:00
parent 3a2d4e6c91
commit 60cf5c92dd

View File

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