Authored by hugufei

去除无用代码

... ... @@ -163,16 +163,6 @@ public class AggregationService extends AbstractCacheAbleService implements Appl
}
/**
* 获取品牌层面的聚合结果
*/
public JSONObject getBrandAggregationResult(Map<String, String> paramMap, boolean needPreAggregation) throws Exception {
IAggregation brandAggregation = aggregationFactoryService.getBrandAggregation(paramMap);
String filterParamName = needPreAggregation ? SearchRequestParams.PARAM_SEARCH_BRAND : null;
SearchParam searchParam = this.genSearchParamForAgg(brandAggregation, paramMap, filterParamName, 0);
return this.getAggNameAndResponseWithCache(brandAggregation, searchParam);
}
/**
* 获取尺码层面的聚合结果
*/
public JSONObject getSizeAggregationResult(Map<String, String> paramMap, boolean needPreAggregation) throws Exception {
... ...
... ... @@ -16,11 +16,6 @@ import com.yoho.search.service.helper.SearchSortHelper;
*/
public class BaseService {
@Autowired
private SearchParamHelper searchParamHelper;
@Autowired
private SearchSortHelper searchSortHelper;
/**
* 增加一个termsQuery
*/
... ... @@ -43,21 +38,6 @@ public class BaseService {
}
/**
* 增加一个rangeQuery
*/
protected BoolQueryBuilder boolQueryBuilderGte(Map<String, String> paramMap, BoolQueryBuilder boolFilter, String fieldName) {
if (paramMap.containsKey(fieldName) && StringUtils.isNotBlank(paramMap.get(fieldName))) {
int begin = Integer.parseInt(paramMap.get(fieldName));
if (begin == 0) {
boolFilter.must(QueryBuilders.termQuery(fieldName, begin));
} else {
boolFilter.must(QueryBuilders.rangeQuery(fieldName).gte(begin));
}
}
return boolFilter;
}
/**
* 通用的过滤请求
*/
protected BoolQueryBuilder generalHandler(Map<String, String> paramMap, BoolQueryBuilder boolFilter) {
... ... @@ -82,14 +62,6 @@ public class BaseService {
}
}
protected int getPageSize(Map<String, String> paramMap) {
int pageSize = StringUtils.isBlank(paramMap.get("viewNum")) ? 30 : Integer.parseInt(paramMap.get("viewNum"));
if (pageSize > 100) {
pageSize = 100;
}
return pageSize;
}
protected int getPage(Map<String, String> paramMap) {
int page = StringUtils.isBlank(paramMap.get("page")) ? 1 : Integer.parseInt(paramMap.get("page"));
return page;
... ...
... ... @@ -27,8 +27,6 @@ public class ProductIndexService implements ApplicationEventPublisherAware {
@Autowired
private AggregationService aggregationService;
@Autowired
private SearchCommonService searchCommonService;
ApplicationEventPublisher publisher;
... ... @@ -125,16 +123,6 @@ public class ProductIndexService implements ApplicationEventPublisherAware {
});
}
public SearchApiResult aggBrand(Map<String, String> paramMap) {
return this.getSearchApiResult("aggBrand", paramMap, new ProductIndexService.Searcher() {
@Override
public Object getResult() throws Exception {
JSONObject jsonObject = aggregationService.getBrandAggregationResult(paramMap, false);
return jsonObject.get("brandAgg");
}
});
}
public SearchApiResult aggStandard(Map<String, String> paramMap) {
return this.getSearchApiResult("aggStandard", paramMap, new ProductIndexService.Searcher() {
@Override
... ...