Authored by hugufei

fix bug

package com.yoho.search.recall.performance.beans;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import javax.annotation.PostConstruct;
import org.apache.commons.collections.MapUtils;
import org.elasticsearch.index.query.BoolQueryBuilder;
import org.elasticsearch.search.sort.SortBuilder;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
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.service.base.SearchCommonService;
import com.yoho.search.service.helper.SearchParamHelper;
import com.yoho.search.recall.performance.model.CommonRecallResult;
import com.yoho.search.recall.performance.model.CommonRecallSkn;
import com.yoho.search.service.base.SearchCommonService;
import com.yoho.search.service.helper.SearchParamHelper;
import org.apache.commons.collections.MapUtils;
import org.elasticsearch.index.query.BoolQueryBuilder;
import org.elasticsearch.search.sort.SortBuilder;
import org.springframework.beans.factory.annotation.Autowired;
import javax.annotation.PostConstruct;
import java.util.*;
public class BaseRecallService {
... ...
... ... @@ -37,14 +37,7 @@ public class BatchRecallCacheBean extends AbstractCacheBean<RecallRequest,Recall
}
//2、执行查询
this.bacthFillResponseWithCache(results,false,10);
//3、返回结果
for (CacheRecallRequestRecallResponse requestResponse:results){
if(requestResponse.getResponse()!=null){
System.out.println(requestResponse.getRequest().requestType()+"+"+requestResponse.getResponse().getTotal()+"_"+requestResponse.getResponse().getSkns().size());
}
}
return results;
}
... ...
... ... @@ -18,7 +18,8 @@ import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.*;
import java.util.List;
import java.util.Map;
@Service
public class DefaultProductListService {
... ...
package com.yoho.search.service.list;
import java.util.List;
import java.util.Map;
import com.yoho.search.service.list.ProductListSwitchService;
import com.yoho.search.service.scene.common.AbstractCacheAbleService;
import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.alibaba.fastjson.JSONObject;
import com.yoho.search.base.utils.ISearchConstants;
import com.yoho.search.common.cache.SearchCacheMatchLogger;
... ... @@ -23,6 +12,15 @@ import com.yoho.search.service.base.SearchCommonService;
import com.yoho.search.service.base.index.ProductIndexBaseService;
import com.yoho.search.service.helper.SearchParamHelper;
import com.yoho.search.service.helper.SearchSortHelper;
import com.yoho.search.service.scene.common.AbstractCacheAbleService;
import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map;
@Service
public class FuzzySceneProductListService extends AbstractCacheAbleService {
... ...
... ... @@ -54,18 +54,18 @@ public class ProductListSwitchService {
if (perfamanceStrategyOpen) {
return performanceRecallProductListService.productList(paramMap);
}
// 3、品类页使用单独的召回页
// 3、品类页-是否使用品类页的召回策略
boolean sortPageRecallOpen = searchDynamicConfigService.isSortPageRecallOpen();
if (sortPageRecallOpen && searchCommonHelper.isSortPageDefault(paramMap)) {
return sortRecallProductListService.productList(paramMap);
}
// 4、全部使用新的召回策略
// 4、是否使用新的召回策略
//boolean searchPersionalNewStrategyOpen = searchDynamicConfigService.searchPersionalNewStrategyOpen();
boolean searchPersionalNewStrategyOpen = true;
if (searchPersionalNewStrategyOpen) {
return sceneRecallProductListService.productList(paramMap);
}
// 5、默认使用向量版本的个性化方案
// 5、默认-使用向量版本的个性化方案
return defaultProductListService.productListForDefaultPersional(paramMap);
}
... ...