优化商品搜索(增加商品基础分数,同goodsId递减。增加销量分数占比)

This commit is contained in:
paulGao
2021-11-08 16:18:30 +08:00
parent b98e01b261
commit c4feaa1546
9 changed files with 311 additions and 235 deletions

View File

@@ -288,9 +288,11 @@ public class GoodsMessageListener implements RocketMQListener<MessageExt> {
* @param goodsSkuList 商品sku信息
*/
private void generatorGoodsIndex(Goods goods, List<GoodsSku> goodsSkuList) {
int skuNo = 100;
for (GoodsSku goodsSku : goodsSkuList) {
EsGoodsIndex esGoodsOld = goodsIndexService.findById(goodsSku.getId());
EsGoodsIndex goodsIndex = this.settingUpGoodsIndexData(goods, goodsSku);
goodsIndex.setSkuNo(skuNo--);
//如果商品库存不为0并且es中有数据
if (goodsSku.getQuantity() > 0 && esGoodsOld == null) {
log.info("生成商品索引 {}", goodsIndex);