Authored by wangnan

Merge branch 'zf_dependency_opt' into test_newcore

... ... @@ -11,7 +11,10 @@ import com.yoho.search.consumer.common.CostStatistics;
import com.yoho.search.consumer.common.PerformanceMonitor;
import com.yoho.search.consumer.index.common.IYohoIndexService;
import com.yoho.search.consumer.index.increment.bulks.StorageSkuIndexToolsService;
import com.yoho.search.consumer.service.base.*;
import com.yoho.search.consumer.service.base.ProductIndexService;
import com.yoho.search.consumer.service.base.ProductPoolDetailService;
import com.yoho.search.consumer.service.base.ProductPriceService;
import com.yoho.search.consumer.service.base.ProductService;
import com.yoho.search.consumer.service.bo.ProductIBO;
import com.yoho.search.consumer.service.bo.StorageSkuBO;
import com.yoho.search.consumer.service.logic.ProductIndexLogicService;
... ... @@ -20,6 +23,7 @@ import com.yoho.search.consumer.service.logic.StorageSkuLogicService;
import com.yoho.search.core.es.utils.IgnoreSomeException;
import com.yoho.search.dal.model.Product;
import com.yoho.search.dal.model.ProductPrice;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
... ... @@ -116,7 +120,7 @@ public class ProductMqListener extends AbstractMqListener implements ChannelAwar
List<Integer> ids = new ArrayList<>();
ids.add(productId);
List<ProductIBO> productIBOs = productIndexLogicService.getProductIs(ids);
if (productIBOs == null) {
if (CollectionUtils.isEmpty(productIBOs)) {
return;
}
ProductIBO productIBO = productIBOs.get(0);
... ...
... ... @@ -274,14 +274,25 @@
"search_analyzer": "standard"
}
},
"type": "multi_field"
"type": "multi_field"
},
"brandNameEn": {
"type": "string",
"store": false,
"analyzer": "lowercase_whitespace",
"search_analyzer": "lowercase_whitespace",
"copy_to": ["searchField","searchField_ansj"]
"fields": {
"brandNameEn": {
"type": "string",
"store": false,
"analyzer": "lowercase_whitespace",
"search_analyzer": "lowercase_whitespace",
"copy_to": ["searchField","searchField_ansj"]
},
"brandNameEn_standard": {
"type": "string",
"store": false,
"analyzer": "standard",
"search_analyzer": "standard"
}
},
"type": "multi_field"
},
"brandKeyword": {
"type": "string",
... ...
... ... @@ -7,6 +7,7 @@ import com.yoho.search.consumer.service.base.ProductActivitiesLinkService;
import com.yoho.search.consumer.service.bo.*;
import com.yoho.search.dal.*;
import com.yoho.search.dal.model.*;
import org.apache.commons.collections.CollectionUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
... ... @@ -126,14 +127,14 @@ public class ProductIndexLogicService {
// 数据量400,可以全量
List<ProductSort> productSorts = this.productSortMapper.getAll();
if (productSorts == null || productSorts.size() == 0) {
logger.error("获取ProductSort列表失败");
if (CollectionUtils.isEmpty(productSorts)) {
return new ArrayList<ProductIBO>();
}
Map<Integer, ProductSort> ProductSortMap = productSorts.stream().parallel().collect(Collectors.toMap(ProductSort::getId, (p) -> p));
// 数据量1500,可以全量
List<Brand> brands = this.brandMapper.getAll();
if (brands == null || brands.size() == 0) {
logger.error("获取Brand列表失败");
if (CollectionUtils.isEmpty(brands)) {
return new ArrayList<ProductIBO>();
}
Map<Integer, Brand> brandMap = brands.stream().parallel().collect(Collectors.toMap(Brand::getId, (p) -> p));
... ...