Authored by hugufei

重命名

... ... @@ -4,7 +4,7 @@ import com.yoho.search.base.utils.ISearchConstants;
import com.yoho.search.base.utils.ProductIndexEsField;
import com.yoho.search.core.es.model.SearchParam;
import com.yoho.search.core.es.model.SearchResult;
import com.yoho.search.dal.model.SimilarSkn;
import com.yoho.search.dal.model.BidataSimilarSkn;
import com.yoho.search.common.SearchCommonService;
import org.apache.commons.beanutils.BeanUtils;
import org.elasticsearch.index.query.BoolQueryBuilder;
... ... @@ -26,7 +26,7 @@ public class BigdataSimilarSknIndexBaseService {
@Autowired
private SearchCommonService searchCommonService;
public SimilarSkn querySimilarSkn(String productSkn) {
public BidataSimilarSkn querySimilarSkn(String productSkn) {
try {
SearchParam searchParam = new SearchParam();
BoolQueryBuilder boolFilter = QueryBuilders.boolQuery();
... ... @@ -45,9 +45,9 @@ public class BigdataSimilarSknIndexBaseService {
return null;
}
Map<String, Object> result = similarSknResults.get(0);
SimilarSkn similarSkn = new SimilarSkn();
BeanUtils.populate(similarSkn, result);
return similarSkn;
BidataSimilarSkn bidataSimilarSkn = new BidataSimilarSkn();
BeanUtils.populate(bidataSimilarSkn, result);
return bidataSimilarSkn;
}catch (Exception e){
logger.error(e.getMessage(),e);
return null;
... ...
... ... @@ -5,7 +5,7 @@ import com.yoho.search.base.utils.SearchCollectionUtils;
import com.yoho.search.base.utils.ProductIndexEsField;
import com.yoho.search.aop.cache.SearchCacheAble;
import com.yoho.search.core.es.model.SearchParam;
import com.yoho.search.dal.model.SimilarSkn;
import com.yoho.search.dal.model.BidataSimilarSkn;
import com.yoho.search.models.SearchApiResult;
import com.yoho.search.common.SearchRequestParams;
import com.yoho.search.service.index.BigdataSimilarSknIndexBaseService;
... ... @@ -69,21 +69,21 @@ public class BigdataSimilarSknService {
return new SearchApiResult().setCode(400).setMessage("SKN不存在");
}
//4、获取similarskn
SimilarSkn similarSkn = bigdataSimilarSknIndexBaseService.querySimilarSkn(productSkn);
BidataSimilarSkn bidataSimilarSkn = bigdataSimilarSknIndexBaseService.querySimilarSkn(productSkn);
//5、构造searchParams
List<SearchParam> searchParams = new ArrayList<>();
//5.1)图片[性别+不同店铺]
List<String> diffShopImgSimilarSkns = new ArrayList<>();
if (similarSkn != null && StringUtils.isNotEmpty(similarSkn.getDiffShopImgSimilarSkns())) {
diffShopImgSimilarSkns = this.getDistinctSknList(similarSkn.getDiffShopImgSimilarSkns());
if (bidataSimilarSkn != null && StringUtils.isNotEmpty(bidataSimilarSkn.getDiffShopImgSimilarSkns())) {
diffShopImgSimilarSkns = this.getDistinctSknList(bidataSimilarSkn.getDiffShopImgSimilarSkns());
}
searchParams.add(this.builderSimilarSknSearchParam(productInfoInEs, diffShopImgSimilarSkns, true));
//5.2)行为[性别+不同店铺+同品类]
List<String> diffShopActionSimilarSkns = new ArrayList<>();
if (similarSkn != null && StringUtils.isNotEmpty(similarSkn.getDiffShopActionSimilarSkns())) {
diffShopActionSimilarSkns = this.getDistinctSknList(similarSkn.getDiffShopActionSimilarSkns());
if (bidataSimilarSkn != null && StringUtils.isNotEmpty(bidataSimilarSkn.getDiffShopActionSimilarSkns())) {
diffShopActionSimilarSkns = this.getDistinctSknList(bidataSimilarSkn.getDiffShopActionSimilarSkns());
}
searchParams.add(this.builderSimilarSknSearchParam(productInfoInEs, diffShopActionSimilarSkns, true));
... ...