diff --git a/framework/src/main/java/cn/lili/modules/search/entity/dos/EsGoodsIndex.java b/framework/src/main/java/cn/lili/modules/search/entity/dos/EsGoodsIndex.java index 07e5d6c28..e8388bd10 100644 --- a/framework/src/main/java/cn/lili/modules/search/entity/dos/EsGoodsIndex.java +++ b/framework/src/main/java/cn/lili/modules/search/entity/dos/EsGoodsIndex.java @@ -1,10 +1,6 @@ package cn.lili.modules.search.entity.dos; -import cn.hutool.core.text.CharSequenceUtil; -import cn.hutool.json.JSONObject; -import cn.hutool.json.JSONUtil; import cn.lili.common.elasticsearch.EsSuffix; -import cn.lili.common.utils.StringUtils; import cn.lili.modules.goods.entity.dos.GoodsParams; import cn.lili.modules.goods.entity.dos.GoodsSku; import com.fasterxml.jackson.annotation.JsonFormat; @@ -300,7 +296,7 @@ public class EsGoodsIndex implements Serializable { List attributes = new ArrayList<>(); for (GoodsParams goodsParam : goodsParams) { EsGoodsAttribute attribute = new EsGoodsAttribute(); - if (goodsParam.getIsIndex() == 1) { + if (goodsParam.getIsIndex() != null && goodsParam.getIsIndex() == 1) { attribute.setType(1); attribute.setName(goodsParam.getParamName()); attribute.setValue(goodsParam.getParamValue()); diff --git a/update-sql/version4.0to4.1.sql b/update-sql/version4.0to4.1.sql index d853abbf1..b7eef5fbd 100644 --- a/update-sql/version4.0to4.1.sql +++ b/update-sql/version4.0to4.1.sql @@ -12,3 +12,6 @@ ALTER TABLE li_coupon ADD range_day_type VARCHAR ( 32 ); ALTER TABLE li_coupon ADD effective_days INT; /**秒杀增加显示商品数量**/ ALTER TABLE li_seckill ADD goods_num INT; + +/**商品参数增加字段**/ +ALTER TABLE li_goods_params ADD is_index INT;