From 942e15d6409dbe9260dce21a45730234de34b630 Mon Sep 17 00:00:00 2001 From: peng <peng.com> Date: 星期二, 23 九月 2025 01:26:25 +0800 Subject: [PATCH] 解决es排序不会被构建到索引中去的问题 --- framework/src/main/java/cn/lili/modules/search/serviceimpl/EsGoodsIndexServiceImpl.java | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/framework/src/main/java/cn/lili/modules/search/serviceimpl/EsGoodsIndexServiceImpl.java b/framework/src/main/java/cn/lili/modules/search/serviceimpl/EsGoodsIndexServiceImpl.java index 291efa1..72e92e0 100644 --- a/framework/src/main/java/cn/lili/modules/search/serviceimpl/EsGoodsIndexServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/search/serviceimpl/EsGoodsIndexServiceImpl.java @@ -45,6 +45,7 @@ import cn.lili.modules.search.service.EsGoodsSearchService; import cn.lili.rocketmq.RocketmqSendCallbackBuilder; import cn.lili.rocketmq.tags.GoodsTagsEnum; +import com.alibaba.fastjson.JSON; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; @@ -256,7 +257,8 @@ if (CollUtil.isNotEmpty(promotionGoods)) { esGoodsIndex.setPromotionMapJson(JSONUtil.toJsonStr(promotionService.wrapperPromotionMapList(promotionGoods))); } - + log.info("鏋勫缓鍑篹s鐨勭储寮曚俊鎭负{}", JSON.toJSONString(esGoodsIndex)); + esGoodsIndex.setGoodsSort(goodsSku.getGoodsSort()); esGoodsIndices.add(esGoodsIndex); //搴撳瓨閿佹槸鍦╮edis鍋氱殑锛屾墍浠ョ敓鎴愮储寮曪紝鍚屾椂鏇存柊涓�涓媟edis涓殑搴撳瓨鏁伴噺 cache.put(GoodsSkuService.getStockCacheKey(goodsSku.getId()), goodsSku.getQuantity()); -- Gitblit v1.8.0