fix SelectionsForPcImpl
Showing
1 changed file
with
4 additions
and
5 deletions
@@ -30,6 +30,7 @@ import com.yoho.search.core.es.model.SearchParam; | @@ -30,6 +30,7 @@ import com.yoho.search.core.es.model.SearchParam; | ||
30 | import com.yoho.search.core.es.model.SearchResult; | 30 | import com.yoho.search.core.es.model.SearchResult; |
31 | import com.yoho.search.service.aggregations.impls.AggregationFactoryService; | 31 | import com.yoho.search.service.aggregations.impls.AggregationFactoryService; |
32 | import com.yoho.search.service.cache.SearchCacheFactory; | 32 | import com.yoho.search.service.cache.SearchCacheFactory; |
33 | +import com.yoho.search.service.cache.SearchCacheMatchLogger; | ||
33 | import com.yoho.search.service.cache.model.SearchCache; | 34 | import com.yoho.search.service.cache.model.SearchCache; |
34 | import com.yoho.search.service.service.SearchCacheService; | 35 | import com.yoho.search.service.service.SearchCacheService; |
35 | import com.yoho.search.service.service.SearchCommonService; | 36 | import com.yoho.search.service.service.SearchCommonService; |
@@ -40,7 +41,6 @@ import com.yoho.search.service.service.base.StyleIndexBaseService; | @@ -40,7 +41,6 @@ import com.yoho.search.service.service.base.StyleIndexBaseService; | ||
40 | import com.yoho.search.service.service.helper.SearchParamHelper; | 41 | import com.yoho.search.service.service.helper.SearchParamHelper; |
41 | import com.yoho.search.service.service.helper.SearchServiceHelper; | 42 | import com.yoho.search.service.service.helper.SearchServiceHelper; |
42 | import com.yoho.search.service.servicenew.ISelectionsForPc; | 43 | import com.yoho.search.service.servicenew.ISelectionsForPc; |
43 | -import com.yoho.search.service.utils.HttpServletRequestUtils; | ||
44 | import com.yoho.search.service.utils.SearchRequestParams; | 44 | import com.yoho.search.service.utils.SearchRequestParams; |
45 | import com.yoho.search.service.vo.SearchApiResult; | 45 | import com.yoho.search.service.vo.SearchApiResult; |
46 | 46 | ||
@@ -78,7 +78,6 @@ public class SelectionsForPcImpl implements ISelectionsForPc { | @@ -78,7 +78,6 @@ public class SelectionsForPcImpl implements ISelectionsForPc { | ||
78 | } | 78 | } |
79 | 79 | ||
80 | private static Logger logger = LoggerFactory.getLogger(SelectionsForPcImpl.class); | 80 | private static Logger logger = LoggerFactory.getLogger(SelectionsForPcImpl.class); |
81 | - private static Logger CACHE_MATCH_REQUEST = LoggerFactory.getLogger("CACHE_MATCH_REQUEST"); | ||
82 | 81 | ||
83 | @Override | 82 | @Override |
84 | public SearchApiResult getSelectionsForPc(Map<String, String> paramMap) { | 83 | public SearchApiResult getSelectionsForPc(Map<String, String> paramMap) { |
@@ -107,7 +106,7 @@ public class SelectionsForPcImpl implements ISelectionsForPc { | @@ -107,7 +106,7 @@ public class SelectionsForPcImpl implements ISelectionsForPc { | ||
107 | JSONObject cacheObject = searchCacheService.getJSONObjectFromCache(aggregationSearchCache, indexName, searchParamClone); | 106 | JSONObject cacheObject = searchCacheService.getJSONObjectFromCache(aggregationSearchCache, indexName, searchParamClone); |
108 | if (cacheObject != null) { | 107 | if (cacheObject != null) { |
109 | Object newCacheObject = searchAfterCacheService.dealFilterCacheObject(cacheObject); | 108 | Object newCacheObject = searchAfterCacheService.dealFilterCacheObject(cacheObject); |
110 | - CACHE_MATCH_REQUEST.info("match cache , url is :/productindex/selectionsForPc.json?" + HttpServletRequestUtils.genParamString(paramMap)); | 109 | + SearchCacheMatchLogger.doSearchCacheMatchLog("/productindex/selectionsForPc.json", paramMap); |
111 | return new SearchApiResult().setData(newCacheObject); | 110 | return new SearchApiResult().setData(newCacheObject); |
112 | } | 111 | } |
113 | 112 | ||
@@ -192,8 +191,8 @@ public class SelectionsForPcImpl implements ISelectionsForPc { | @@ -192,8 +191,8 @@ public class SelectionsForPcImpl implements ISelectionsForPc { | ||
192 | * @return | 191 | * @return |
193 | * @throws Exception | 192 | * @throws Exception |
194 | */ | 193 | */ |
195 | - private Object doPreSearch(SearchParam searchParam, Map<String, String> paramMap) throws Exception { | ||
196 | - final String indexName = ISearchConstants.INDEX_NAME_PRODUCT_INDEX; | 194 | + private Object doPreSearch(SearchParam searchParam, Map<String, String> paramMap) { |
195 | + String indexName = ISearchConstants.INDEX_NAME_PRODUCT_INDEX; | ||
197 | 196 | ||
198 | SearchResult searchResult = searchCommonService.doSearch(indexName, searchParam); | 197 | SearchResult searchResult = searchCommonService.doSearch(indexName, searchParam); |
199 | Map<String, Aggregation> aggMaps = searchResult.getAggMaps(); | 198 | Map<String, Aggregation> aggMaps = searchResult.getAggMaps(); |
-
Please register or login to post a comment