Authored by hugufei

fix bug

1 package com.yoho.search.recall.performance.beans; 1 package com.yoho.search.recall.performance.beans;
2 2
3 -import java.util.ArrayList;  
4 -import java.util.HashSet;  
5 -import java.util.List;  
6 -import java.util.Map;  
7 -import java.util.Set;  
8 -  
9 -import javax.annotation.PostConstruct;  
10 -  
11 -import org.apache.commons.collections.MapUtils;  
12 -import org.elasticsearch.index.query.BoolQueryBuilder;  
13 -import org.elasticsearch.search.sort.SortBuilder;  
14 -import org.springframework.beans.factory.annotation.Autowired;  
15 -import org.springframework.stereotype.Component;  
16 -  
17 import com.yoho.search.base.utils.ProductIndexEsField; 3 import com.yoho.search.base.utils.ProductIndexEsField;
18 import com.yoho.search.core.es.model.SearchParam; 4 import com.yoho.search.core.es.model.SearchParam;
19 import com.yoho.search.core.es.model.SearchResult; 5 import com.yoho.search.core.es.model.SearchResult;
20 -import com.yoho.search.service.base.SearchCommonService;  
21 -import com.yoho.search.service.helper.SearchParamHelper;  
22 import com.yoho.search.recall.performance.model.CommonRecallResult; 6 import com.yoho.search.recall.performance.model.CommonRecallResult;
23 import com.yoho.search.recall.performance.model.CommonRecallSkn; 7 import com.yoho.search.recall.performance.model.CommonRecallSkn;
  8 +import com.yoho.search.service.base.SearchCommonService;
  9 +import com.yoho.search.service.helper.SearchParamHelper;
  10 +import org.apache.commons.collections.MapUtils;
  11 +import org.elasticsearch.index.query.BoolQueryBuilder;
  12 +import org.elasticsearch.search.sort.SortBuilder;
  13 +import org.springframework.beans.factory.annotation.Autowired;
  14 +
  15 +import javax.annotation.PostConstruct;
  16 +import java.util.*;
24 17
25 public class BaseRecallService { 18 public class BaseRecallService {
26 19
@@ -37,14 +37,7 @@ public class BatchRecallCacheBean extends AbstractCacheBean<RecallRequest,Recall @@ -37,14 +37,7 @@ public class BatchRecallCacheBean extends AbstractCacheBean<RecallRequest,Recall
37 } 37 }
38 //2、执行查询 38 //2、执行查询
39 this.bacthFillResponseWithCache(results,false,10); 39 this.bacthFillResponseWithCache(results,false,10);
40 -  
41 //3、返回结果 40 //3、返回结果
42 - for (CacheRecallRequestRecallResponse requestResponse:results){  
43 - if(requestResponse.getResponse()!=null){  
44 - System.out.println(requestResponse.getRequest().requestType()+"+"+requestResponse.getResponse().getTotal()+"_"+requestResponse.getResponse().getSkns().size());  
45 - }  
46 - }  
47 -  
48 return results; 41 return results;
49 } 42 }
50 43
@@ -18,7 +18,8 @@ import org.slf4j.LoggerFactory; @@ -18,7 +18,8 @@ import org.slf4j.LoggerFactory;
18 import org.springframework.beans.factory.annotation.Autowired; 18 import org.springframework.beans.factory.annotation.Autowired;
19 import org.springframework.stereotype.Service; 19 import org.springframework.stereotype.Service;
20 20
21 -import java.util.*; 21 +import java.util.List;
  22 +import java.util.Map;
22 23
23 @Service 24 @Service
24 public class DefaultProductListService { 25 public class DefaultProductListService {
1 package com.yoho.search.service.list; 1 package com.yoho.search.service.list;
2 2
3 -import java.util.List;  
4 -import java.util.Map;  
5 -  
6 -import com.yoho.search.service.list.ProductListSwitchService;  
7 -import com.yoho.search.service.scene.common.AbstractCacheAbleService;  
8 -import org.apache.commons.lang.StringUtils;  
9 -import org.slf4j.Logger;  
10 -import org.slf4j.LoggerFactory;  
11 -import org.springframework.beans.factory.annotation.Autowired;  
12 -import org.springframework.stereotype.Service;  
13 -  
14 import com.alibaba.fastjson.JSONObject; 3 import com.alibaba.fastjson.JSONObject;
15 import com.yoho.search.base.utils.ISearchConstants; 4 import com.yoho.search.base.utils.ISearchConstants;
16 import com.yoho.search.common.cache.SearchCacheMatchLogger; 5 import com.yoho.search.common.cache.SearchCacheMatchLogger;
@@ -23,6 +12,15 @@ import com.yoho.search.service.base.SearchCommonService; @@ -23,6 +12,15 @@ import com.yoho.search.service.base.SearchCommonService;
23 import com.yoho.search.service.base.index.ProductIndexBaseService; 12 import com.yoho.search.service.base.index.ProductIndexBaseService;
24 import com.yoho.search.service.helper.SearchParamHelper; 13 import com.yoho.search.service.helper.SearchParamHelper;
25 import com.yoho.search.service.helper.SearchSortHelper; 14 import com.yoho.search.service.helper.SearchSortHelper;
  15 +import com.yoho.search.service.scene.common.AbstractCacheAbleService;
  16 +import org.apache.commons.lang.StringUtils;
  17 +import org.slf4j.Logger;
  18 +import org.slf4j.LoggerFactory;
  19 +import org.springframework.beans.factory.annotation.Autowired;
  20 +import org.springframework.stereotype.Service;
  21 +
  22 +import java.util.List;
  23 +import java.util.Map;
26 24
27 @Service 25 @Service
28 public class FuzzySceneProductListService extends AbstractCacheAbleService { 26 public class FuzzySceneProductListService extends AbstractCacheAbleService {
@@ -54,18 +54,18 @@ public class ProductListSwitchService { @@ -54,18 +54,18 @@ public class ProductListSwitchService {
54 if (perfamanceStrategyOpen) { 54 if (perfamanceStrategyOpen) {
55 return performanceRecallProductListService.productList(paramMap); 55 return performanceRecallProductListService.productList(paramMap);
56 } 56 }
57 - // 3、品类页使用单独的召回页 57 + // 3、品类页-是否使用品类页的召回策略
58 boolean sortPageRecallOpen = searchDynamicConfigService.isSortPageRecallOpen(); 58 boolean sortPageRecallOpen = searchDynamicConfigService.isSortPageRecallOpen();
59 if (sortPageRecallOpen && searchCommonHelper.isSortPageDefault(paramMap)) { 59 if (sortPageRecallOpen && searchCommonHelper.isSortPageDefault(paramMap)) {
60 return sortRecallProductListService.productList(paramMap); 60 return sortRecallProductListService.productList(paramMap);
61 } 61 }
62 - // 4、全部使用新的召回策略 62 + // 4、是否使用新的召回策略
63 //boolean searchPersionalNewStrategyOpen = searchDynamicConfigService.searchPersionalNewStrategyOpen(); 63 //boolean searchPersionalNewStrategyOpen = searchDynamicConfigService.searchPersionalNewStrategyOpen();
64 boolean searchPersionalNewStrategyOpen = true; 64 boolean searchPersionalNewStrategyOpen = true;
65 if (searchPersionalNewStrategyOpen) { 65 if (searchPersionalNewStrategyOpen) {
66 return sceneRecallProductListService.productList(paramMap); 66 return sceneRecallProductListService.productList(paramMap);
67 } 67 }
68 - // 5、默认使用向量版本的个性化方案 68 + // 5、默认-使用向量版本的个性化方案
69 return defaultProductListService.productListForDefaultPersional(paramMap); 69 return defaultProductListService.productListForDefaultPersional(paramMap);
70 } 70 }
71 71