Authored by hugufei

去除无用代码

@@ -163,16 +163,6 @@ public class AggregationService extends AbstractCacheAbleService implements Appl @@ -163,16 +163,6 @@ public class AggregationService extends AbstractCacheAbleService implements Appl
163 } 163 }
164 164
165 /** 165 /**
166 - * 获取品牌层面的聚合结果  
167 - */  
168 - public JSONObject getBrandAggregationResult(Map<String, String> paramMap, boolean needPreAggregation) throws Exception {  
169 - IAggregation brandAggregation = aggregationFactoryService.getBrandAggregation(paramMap);  
170 - String filterParamName = needPreAggregation ? SearchRequestParams.PARAM_SEARCH_BRAND : null;  
171 - SearchParam searchParam = this.genSearchParamForAgg(brandAggregation, paramMap, filterParamName, 0);  
172 - return this.getAggNameAndResponseWithCache(brandAggregation, searchParam);  
173 - }  
174 -  
175 - /**  
176 * 获取尺码层面的聚合结果 166 * 获取尺码层面的聚合结果
177 */ 167 */
178 public JSONObject getSizeAggregationResult(Map<String, String> paramMap, boolean needPreAggregation) throws Exception { 168 public JSONObject getSizeAggregationResult(Map<String, String> paramMap, boolean needPreAggregation) throws Exception {
@@ -16,11 +16,6 @@ import com.yoho.search.service.helper.SearchSortHelper; @@ -16,11 +16,6 @@ import com.yoho.search.service.helper.SearchSortHelper;
16 */ 16 */
17 public class BaseService { 17 public class BaseService {
18 18
19 - @Autowired  
20 - private SearchParamHelper searchParamHelper;  
21 - @Autowired  
22 - private SearchSortHelper searchSortHelper;  
23 -  
24 /** 19 /**
25 * 增加一个termsQuery 20 * 增加一个termsQuery
26 */ 21 */
@@ -43,21 +38,6 @@ public class BaseService { @@ -43,21 +38,6 @@ public class BaseService {
43 } 38 }
44 39
45 /** 40 /**
46 - * 增加一个rangeQuery  
47 - */  
48 - protected BoolQueryBuilder boolQueryBuilderGte(Map<String, String> paramMap, BoolQueryBuilder boolFilter, String fieldName) {  
49 - if (paramMap.containsKey(fieldName) && StringUtils.isNotBlank(paramMap.get(fieldName))) {  
50 - int begin = Integer.parseInt(paramMap.get(fieldName));  
51 - if (begin == 0) {  
52 - boolFilter.must(QueryBuilders.termQuery(fieldName, begin));  
53 - } else {  
54 - boolFilter.must(QueryBuilders.rangeQuery(fieldName).gte(begin));  
55 - }  
56 - }  
57 - return boolFilter;  
58 - }  
59 -  
60 - /**  
61 * 通用的过滤请求 41 * 通用的过滤请求
62 */ 42 */
63 protected BoolQueryBuilder generalHandler(Map<String, String> paramMap, BoolQueryBuilder boolFilter) { 43 protected BoolQueryBuilder generalHandler(Map<String, String> paramMap, BoolQueryBuilder boolFilter) {
@@ -82,14 +62,6 @@ public class BaseService { @@ -82,14 +62,6 @@ public class BaseService {
82 } 62 }
83 } 63 }
84 64
85 - protected int getPageSize(Map<String, String> paramMap) {  
86 - int pageSize = StringUtils.isBlank(paramMap.get("viewNum")) ? 30 : Integer.parseInt(paramMap.get("viewNum"));  
87 - if (pageSize > 100) {  
88 - pageSize = 100;  
89 - }  
90 - return pageSize;  
91 - }  
92 -  
93 protected int getPage(Map<String, String> paramMap) { 65 protected int getPage(Map<String, String> paramMap) {
94 int page = StringUtils.isBlank(paramMap.get("page")) ? 1 : Integer.parseInt(paramMap.get("page")); 66 int page = StringUtils.isBlank(paramMap.get("page")) ? 1 : Integer.parseInt(paramMap.get("page"));
95 return page; 67 return page;
@@ -27,8 +27,6 @@ public class ProductIndexService implements ApplicationEventPublisherAware { @@ -27,8 +27,6 @@ public class ProductIndexService implements ApplicationEventPublisherAware {
27 27
28 @Autowired 28 @Autowired
29 private AggregationService aggregationService; 29 private AggregationService aggregationService;
30 - @Autowired  
31 - private SearchCommonService searchCommonService;  
32 30
33 ApplicationEventPublisher publisher; 31 ApplicationEventPublisher publisher;
34 32
@@ -125,16 +123,6 @@ public class ProductIndexService implements ApplicationEventPublisherAware { @@ -125,16 +123,6 @@ public class ProductIndexService implements ApplicationEventPublisherAware {
125 }); 123 });
126 } 124 }
127 125
128 - public SearchApiResult aggBrand(Map<String, String> paramMap) {  
129 - return this.getSearchApiResult("aggBrand", paramMap, new ProductIndexService.Searcher() {  
130 - @Override  
131 - public Object getResult() throws Exception {  
132 - JSONObject jsonObject = aggregationService.getBrandAggregationResult(paramMap, false);  
133 - return jsonObject.get("brandAgg");  
134 - }  
135 - });  
136 - }  
137 -  
138 public SearchApiResult aggStandard(Map<String, String> paramMap) { 126 public SearchApiResult aggStandard(Map<String, String> paramMap) {
139 return this.getSearchApiResult("aggStandard", paramMap, new ProductIndexService.Searcher() { 127 return this.getSearchApiResult("aggStandard", paramMap, new ProductIndexService.Searcher() {
140 @Override 128 @Override