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 73792f465..efd86c71c 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 @@ -159,7 +159,7 @@ private EsGoodsRelatedInfo convertToEsGoodsRelatedInfo(Map String categoryNamePath = categoryPath; - if (!categoryBuckets.isEmpty()) { + if (!categoryNameBuckets.isEmpty()) { categoryNamePath = categoryNameBuckets.get(0).getKey().toString(); } String[] split = ArrayUtil.distinct(categoryPath.split(",")); @@ -187,6 +187,10 @@ private EsGoodsRelatedInfo convertToEsGoodsRelatedInfo(Map if (brandBuckets != null && !brandBuckets.isEmpty()) { for (int i = 0; i < brandBuckets.size(); i++) { String brandId = brandBuckets.get(i).getKey().toString(); + //当商品品牌id为0时,代表商品没有选择品牌,所以过滤掉品牌选择器 + if (brandId.equals("0")) { + continue; + } if (CharSequenceUtil.isNotEmpty(goodsSearch.getBrandId())) { List brandList = Arrays.asList(goodsSearch.getBrandId().split("@")); if (brandList.contains(brandId)) {