Authored by hugufei

拆包

Showing 47 changed files with 105 additions and 158 deletions
... ... @@ -14,7 +14,7 @@ import com.yoho.search.common.utils.HttpServletRequestUtils;
import com.yoho.search.models.SearchApiResult;
import com.yoho.search.service.scene.brandshop.BrandService;
import com.yoho.search.service.scene.common.ProductCountService;
import com.yoho.search.service.scene.aggregations.ProductIndexService;
import com.yoho.search.service.scene.aggregations.ProductIndexAggService;
import com.yoho.search.service.scene.aggregations.SelectionsForApp;
import com.yoho.search.service.scene.aggregations.SelectionsForPc;
... ... @@ -23,7 +23,7 @@ import com.yoho.search.service.scene.aggregations.SelectionsForPc;
public class ProductIndexController {
@Autowired
private ProductIndexService productIndexService;
private ProductIndexAggService productIndexAggService;
@Autowired
private SelectionsForPc selectionsWithAdvanceService;
@Autowired
... ... @@ -40,7 +40,7 @@ public class ProductIndexController {
@ResponseBody
public SearchApiResult aggGender(HttpServletRequest request) {
Map<String, String> paramMap = HttpServletRequestUtils.transParamType(request);
return productIndexService.aggGender(paramMap);
return productIndexAggService.aggGender(paramMap);
}
/**
... ... @@ -50,7 +50,7 @@ public class ProductIndexController {
@ResponseBody
public SearchApiResult aggAgeLevel(HttpServletRequest request) {
Map<String, String> paramMap = HttpServletRequestUtils.transParamType(request);
return productIndexService.aggAgeLevel(paramMap);
return productIndexAggService.aggAgeLevel(paramMap);
}
/**
... ... @@ -60,7 +60,7 @@ public class ProductIndexController {
@ResponseBody
public SearchApiResult aggPrice(HttpServletRequest request) {
Map<String, String> paramMap = HttpServletRequestUtils.transParamType(request);
return productIndexService.aggPrice(paramMap);
return productIndexAggService.aggPrice(paramMap);
}
/**
... ... @@ -70,7 +70,7 @@ public class ProductIndexController {
@ResponseBody
public SearchApiResult aggColor(HttpServletRequest request) {
Map<String, String> paramMap = HttpServletRequestUtils.transParamType(request);
return productIndexService.aggColor(paramMap);
return productIndexAggService.aggColor(paramMap);
}
/**
... ... @@ -80,7 +80,7 @@ public class ProductIndexController {
@ResponseBody
public SearchApiResult aggStyle(HttpServletRequest request) {
Map<String, String> paramMap = HttpServletRequestUtils.transParamType(request);
return productIndexService.aggStyle(paramMap);
return productIndexAggService.aggStyle(paramMap);
}
/**
... ... @@ -90,7 +90,7 @@ public class ProductIndexController {
@ResponseBody
public SearchApiResult aggStandard(HttpServletRequest request) {
Map<String, String> paramMap = HttpServletRequestUtils.transParamType(request);
return productIndexService.aggStandard(paramMap);
return productIndexAggService.aggStandard(paramMap);
}
/**
... ... @@ -100,7 +100,7 @@ public class ProductIndexController {
@ResponseBody
public SearchApiResult aggSize(HttpServletRequest request) {
Map<String, String> paramMap = HttpServletRequestUtils.transParamType(request);
return productIndexService.aggSize(paramMap);
return productIndexAggService.aggSize(paramMap);
}
/**
... ... @@ -110,7 +110,7 @@ public class ProductIndexController {
@ResponseBody
public SearchApiResult aggNew(HttpServletRequest request) {
Map<String, String> paramMap = HttpServletRequestUtils.transParamType(request);
return productIndexService.aggNew(paramMap);
return productIndexAggService.aggNew(paramMap);
}
/**
... ... @@ -120,7 +120,7 @@ public class ProductIndexController {
@ResponseBody
public SearchApiResult aggLimited(HttpServletRequest request) {
Map<String, String> paramMap = HttpServletRequestUtils.transParamType(request);
return productIndexService.aggLimited(paramMap);
return productIndexAggService.aggLimited(paramMap);
}
/**
... ... @@ -130,7 +130,7 @@ public class ProductIndexController {
@ResponseBody
public SearchApiResult aggSpecialoffer(HttpServletRequest request) {
Map<String, String> paramMap = HttpServletRequestUtils.transParamType(request);
return productIndexService.aggSpecialoffer(paramMap);
return productIndexAggService.aggSpecialoffer(paramMap);
}
/**
... ... @@ -140,7 +140,7 @@ public class ProductIndexController {
@ResponseBody
public SearchApiResult aggShop(HttpServletRequest request) {
Map<String, String> paramMap = HttpServletRequestUtils.transParamType(request);
return productIndexService.aggShops(paramMap);
return productIndexAggService.aggShops(paramMap);
}
/**
... ... @@ -150,7 +150,7 @@ public class ProductIndexController {
@ResponseBody
public SearchApiResult recommendKeyword(HttpServletRequest request) {
Map<String, String> paramMap = HttpServletRequestUtils.transParamType(request);
return productIndexService.aggKeywords(paramMap);
return productIndexAggService.aggKeywords(paramMap);
}
/**
... ... @@ -200,7 +200,7 @@ public class ProductIndexController {
@ResponseBody
public SearchApiResult aggPromotion(HttpServletRequest request) {
Map<String, String> paramMap = HttpServletRequestUtils.transParamType(request);
return productIndexService.aggPromotion(paramMap);
return productIndexAggService.aggPromotion(paramMap);
}
}
... ...
package com.yoho.search.service.scene.aggregations;
package com.yoho.search.service.aggregations;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
... ... @@ -11,7 +11,7 @@ import com.yoho.search.core.es.agg.IAggregation;
import com.yoho.search.core.es.model.SearchParam;
import com.yoho.search.core.es.model.SearchResult;
import com.yoho.search.core.es.utils.IgnoreSomeException;
import com.yoho.search.service.scene.aggregations.impls.AggregationFactory;
import com.yoho.search.service.aggregations.impls.AggregationFactory;
import com.yoho.search.service.scene.hongren.ShopProductCacheBean;
import com.yoho.search.service.recall.models.common.ParamQueryFilter;
import com.yoho.search.service.scene.hongren.ShopProductRequest;
... ... @@ -35,9 +35,9 @@ import java.util.*;
import java.util.stream.Collectors;
@Service
public class AggregationService extends AbstractCacheAbleService implements ApplicationEventPublisherAware {
public class AggregationsService extends AbstractCacheAbleService implements ApplicationEventPublisherAware {
private static final Logger logger = LoggerFactory.getLogger(AggregationService.class);
private static final Logger logger = LoggerFactory.getLogger(AggregationsService.class);
@Autowired
private AggregationFactory aggregationFactory;
... ...
package com.yoho.search.service.scene.aggregations.impls;
package com.yoho.search.service.aggregations.impls;
import com.yoho.search.core.es.agg.AbstractAggregation;
import org.elasticsearch.search.aggregations.AbstractAggregationBuilder;
... ...
package com.yoho.search.service.scene.aggregations.impls;
package com.yoho.search.service.aggregations.impls;
import java.util.ArrayList;
import java.util.HashMap;
... ...
package com.yoho.search.service.scene.aggregations.impls;
package com.yoho.search.service.aggregations.impls;
import com.yoho.search.core.es.agg.IAggregation;
import com.yoho.search.service.index.promotion.PromotionIndexBaseService;
... ...
package com.yoho.search.service.scene.aggregations.impls;
package com.yoho.search.service.aggregations.impls;
import java.util.ArrayList;
import java.util.Iterator;
... ...
package com.yoho.search.service.scene.aggregations.impls;
package com.yoho.search.service.aggregations.impls;
import com.yoho.search.base.utils.ProductIndexEsField;
... ...
package com.yoho.search.service.scene.aggregations.impls;
package com.yoho.search.service.aggregations.impls;
import java.util.Iterator;
import java.util.LinkedHashSet;
... ...
package com.yoho.search.service.scene.aggregations.impls;
package com.yoho.search.service.aggregations.impls;
import java.util.ArrayList;
import java.util.List;
... ...
package com.yoho.search.service.scene.aggregations.impls;
package com.yoho.search.service.aggregations.impls;
import java.util.HashMap;
import java.util.Iterator;
... ...
package com.yoho.search.service.scene.aggregations.impls;
package com.yoho.search.service.aggregations.impls;
import java.util.Iterator;
import java.util.LinkedHashMap;
... ...
package com.yoho.search.service.scene.aggregations.impls;
package com.yoho.search.service.aggregations.impls;
import java.util.Iterator;
import java.util.LinkedHashMap;
... ...
package com.yoho.search.service.scene.aggregations.impls;
package com.yoho.search.service.aggregations.impls;
import java.util.ArrayList;
import java.util.Arrays;
... ...
package com.yoho.search.service.scene.aggregations.impls;
package com.yoho.search.service.aggregations.impls;
import java.util.ArrayList;
import java.util.Arrays;
... ...
package com.yoho.search.service.scene.aggregations.impls;
package com.yoho.search.service.aggregations.impls;
import java.util.Iterator;
import java.util.Map;
... ...
package com.yoho.search.service.scene.aggregations.impls;
package com.yoho.search.service.aggregations.impls;
import java.util.Iterator;
import java.util.Map;
... ...
package com.yoho.search.service.scene.aggregations.impls;
package com.yoho.search.service.aggregations.impls;
import java.util.Iterator;
import java.util.Map;
... ...
package com.yoho.search.service.scene.aggregations.impls;
package com.yoho.search.service.aggregations.impls;
import java.util.Iterator;
import java.util.Map;
... ...
package com.yoho.search.service.scene.aggregations.impls;
package com.yoho.search.service.aggregations.impls;
import java.util.Arrays;
import java.util.List;
... ...
package com.yoho.search.service.scene.aggregations.impls;
package com.yoho.search.service.aggregations.impls;
import java.util.Iterator;
import java.util.LinkedHashMap;
... ...
package com.yoho.search.service.scene.aggregations.impls;
package com.yoho.search.service.aggregations.impls;
import com.yoho.search.base.utils.DateUtil;
import com.yoho.search.base.utils.ProductIndexEsField;
... ...
package com.yoho.search.service.scene.aggregations.impls;
package com.yoho.search.service.aggregations.impls;
import java.util.Iterator;
import java.util.LinkedHashMap;
... ...
package com.yoho.search.service.scene.aggregations.impls;
package com.yoho.search.service.aggregations.impls;
import java.util.ArrayList;
import java.util.List;
... ...
package com.yoho.search.service.scene.aggregations.impls;
package com.yoho.search.service.aggregations.impls;
import com.yoho.search.base.utils.DateUtil;
import com.yoho.search.base.utils.ProductIndexEsField;
... ...
package com.yoho.search.service.scene.aggregations.impls;
package com.yoho.search.service.aggregations.impls;
import java.util.ArrayList;
import java.util.HashMap;
... ...
package com.yoho.search.service.scene.aggregations.impls;
package com.yoho.search.service.aggregations.impls;
import java.util.ArrayList;
import java.util.HashMap;
... ...
package com.yoho.search.service.scene.aggregations.impls;
package com.yoho.search.service.aggregations.impls;
import com.yoho.search.base.utils.ProductIndexEsField;
import org.apache.commons.lang3.StringUtils;
... ...
package com.yoho.search.service.scene.aggregations.impls;
package com.yoho.search.service.aggregations.impls;
import java.util.Iterator;
import java.util.LinkedHashSet;
... ...
package com.yoho.search.service.scene.aggregations.impls;
package com.yoho.search.service.aggregations.impls;
import java.util.ArrayList;
import java.util.Collections;
... ...
package com.yoho.search.service.scene.aggregations.impls;
package com.yoho.search.service.aggregations.impls;
import java.util.ArrayList;
import java.util.HashMap;
... ...
package com.yoho.search.service.scene.aggregations.impls;
package com.yoho.search.service.aggregations.impls;
import java.util.Iterator;
import java.util.LinkedHashSet;
... ...
package com.yoho.search.service.scene.aggregations.impls;
package com.yoho.search.service.aggregations.impls;
import com.yoho.search.base.utils.ProductIndexEsField;
import com.yoho.search.service.index.ZqNameIndexBaseService;
... ...
... ... @@ -13,7 +13,7 @@ import com.yoho.search.core.es.agg.IAggregation;
import com.yoho.search.core.es.model.SearchParam;
import com.yoho.search.core.es.model.SearchResult;
import com.yoho.search.core.es.utils.IgnoreSomeException;
import com.yoho.search.service.scene.aggregations.impls.AggregationFactory;
import com.yoho.search.service.aggregations.impls.AggregationFactory;
import com.yoho.search.common.SearchCommonService;
import com.yoho.search.service.helper.SearchAfterCacheHelper;
import com.yoho.search.service.helper.SearchParamHelper;
... ...
... ... @@ -6,6 +6,7 @@ import com.yoho.search.base.utils.EventReportEnum;
import com.yoho.search.base.utils.JsonUtil;
import com.yoho.search.core.es.utils.IgnoreSomeException;
import com.yoho.search.models.SearchApiResult;
import com.yoho.search.service.aggregations.AggregationsService;
import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
... ... @@ -20,12 +21,12 @@ import java.util.Random;
import java.util.stream.Collectors;
@Service
public class ProductIndexService implements ApplicationEventPublisherAware {
public class ProductIndexAggService implements ApplicationEventPublisherAware {
private static final Logger logger = LoggerFactory.getLogger(ProductIndexService.class);
private static final Logger logger = LoggerFactory.getLogger(ProductIndexAggService.class);
@Autowired
private AggregationService aggregationService;
private AggregationsService aggregationsService;
ApplicationEventPublisher publisher;
... ... @@ -55,7 +56,7 @@ public class ProductIndexService implements ApplicationEventPublisherAware {
public Object getResult() throws Exception;
}
private SearchApiResult getSearchApiResult(String methodName, Map<String, String> paramMap, ProductIndexService.Searcher searcher) {
private SearchApiResult getSearchApiResult(String methodName, Map<String, String> paramMap, ProductIndexAggService.Searcher searcher) {
long begin = System.currentTimeMillis();
logger.info("[model=ProductIndexService][func={}][param={}][begin={}]", methodName, paramMap.toString(), begin);
try {
... ... @@ -73,90 +74,90 @@ public class ProductIndexService implements ApplicationEventPublisherAware {
}
public SearchApiResult aggAgeLevel(Map<String, String> paramMap) {
return this.getSearchApiResult("aggAgeLevel", paramMap, new ProductIndexService.Searcher() {
return this.getSearchApiResult("aggAgeLevel", paramMap, new ProductIndexAggService.Searcher() {
@Override
public Object getResult() throws Exception {
JSONObject jsonObject = aggregationService.getAgeLevelAggregationResult(paramMap, false);
JSONObject jsonObject = aggregationsService.getAgeLevelAggregationResult(paramMap, false);
return jsonObject.get("ageLevelAgg");
}
});
}
public SearchApiResult aggGender(Map<String, String> paramMap) {
return this.getSearchApiResult("aggGender", paramMap, new ProductIndexService.Searcher() {
return this.getSearchApiResult("aggGender", paramMap, new ProductIndexAggService.Searcher() {
@Override
public Object getResult() throws Exception {
JSONObject jsonObject = aggregationService.getGenderNewAggregationResult(paramMap, false);
JSONObject jsonObject = aggregationsService.getGenderNewAggregationResult(paramMap, false);
return jsonObject.get("genderAgg");
}
});
}
public SearchApiResult aggPrice(Map<String, String> paramMap) {
return this.getSearchApiResult("aggPrice", paramMap, new ProductIndexService.Searcher() {
return this.getSearchApiResult("aggPrice", paramMap, new ProductIndexAggService.Searcher() {
@Override
public Object getResult() throws Exception {
JSONObject jsonObject = aggregationService.getPriceAggregationResult(paramMap, false);
JSONObject jsonObject = aggregationsService.getPriceAggregationResult(paramMap, false);
return jsonObject.get("priceAgg");
}
});
}
public SearchApiResult aggColor(Map<String, String> paramMap) {
return this.getSearchApiResult("aggColor", paramMap, new ProductIndexService.Searcher() {
return this.getSearchApiResult("aggColor", paramMap, new ProductIndexAggService.Searcher() {
@Override
public Object getResult() throws Exception {
JSONObject jsonObject = aggregationService.getColorAggregationResult(paramMap, false);
JSONObject jsonObject = aggregationsService.getColorAggregationResult(paramMap, false);
return jsonObject.get("colorAgg");
}
});
}
public SearchApiResult aggStyle(Map<String, String> paramMap) {
return this.getSearchApiResult("aggStyle", paramMap, new ProductIndexService.Searcher() {
return this.getSearchApiResult("aggStyle", paramMap, new ProductIndexAggService.Searcher() {
@Override
public Object getResult() throws Exception {
JSONObject jsonObject = aggregationService.getStyleAggregationResult(paramMap, false);
JSONObject jsonObject = aggregationsService.getStyleAggregationResult(paramMap, false);
return jsonObject.get("styleAgg");
}
});
}
public SearchApiResult aggStandard(Map<String, String> paramMap) {
return this.getSearchApiResult("aggStandard", paramMap, new ProductIndexService.Searcher() {
return this.getSearchApiResult("aggStandard", paramMap, new ProductIndexAggService.Searcher() {
@Override
public Object getResult() throws Exception {
JSONObject jsonObject = aggregationService.getStandardAggregationResult(paramMap);
JSONObject jsonObject = aggregationsService.getStandardAggregationResult(paramMap);
return jsonObject.get("standardAgg");
}
});
}
public SearchApiResult aggSize(Map<String, String> paramMap) {
return this.getSearchApiResult("aggSize", paramMap, new ProductIndexService.Searcher() {
return this.getSearchApiResult("aggSize", paramMap, new ProductIndexAggService.Searcher() {
@Override
public Object getResult() throws Exception {
JSONObject jsonObject = aggregationService.getSizeAggregationResult(paramMap, false);
JSONObject jsonObject = aggregationsService.getSizeAggregationResult(paramMap, false);
return jsonObject.get("sizeAgg");
}
});
}
public SearchApiResult aggPromotion(Map<String, String> paramMap) {
return this.getSearchApiResult("aggPromotion", paramMap, new ProductIndexService.Searcher() {
return this.getSearchApiResult("aggPromotion", paramMap, new ProductIndexAggService.Searcher() {
@Override
public Object getResult() throws Exception {
JSONObject jsonObject = aggregationService.getPromotionAggregationResult(paramMap, 1000);
JSONObject jsonObject = aggregationsService.getPromotionAggregationResult(paramMap, 1000);
return jsonObject.get("promotionAgg");
}
});
}
public SearchApiResult aggShops(Map<String, String> paramMap) {
return this.getSearchApiResult("aggShops", paramMap, new ProductIndexService.Searcher() {
return this.getSearchApiResult("aggShops", paramMap, new ProductIndexAggService.Searcher() {
@Override
public Object getResult() throws Exception {
JSONObject jsonObject = aggregationService.getShopAggregationResult(paramMap, 100);
JSONObject jsonObject = aggregationsService.getShopAggregationResult(paramMap, 100);
return jsonObject.get("shopAgg");
}
});
... ... @@ -164,10 +165,10 @@ public class ProductIndexService implements ApplicationEventPublisherAware {
public SearchApiResult aggNew(Map<String, String> paramMap) {
return this.getSearchApiResult("aggNew", paramMap, new ProductIndexService.Searcher() {
return this.getSearchApiResult("aggNew", paramMap, new ProductIndexAggService.Searcher() {
@Override
public Object getResult() throws Exception {
JSONObject jsonObject = aggregationService.getIsNewAggregationResult(paramMap, false);
JSONObject jsonObject = aggregationsService.getIsNewAggregationResult(paramMap, false);
Object isNewResponse = jsonObject.get("isnewAgg");
if (isNewResponse != null && ((Boolean) isNewResponse).booleanValue()) {
return "Y";
... ... @@ -179,10 +180,10 @@ public class ProductIndexService implements ApplicationEventPublisherAware {
}
public SearchApiResult aggLimited(Map<String, String> paramMap) {
return this.getSearchApiResult("aggLimited", paramMap, new ProductIndexService.Searcher() {
return this.getSearchApiResult("aggLimited", paramMap, new ProductIndexAggService.Searcher() {
@Override
public Object getResult() throws Exception {
JSONObject jsonObject = aggregationService.getIsLimitAggregationResult(paramMap, false);
JSONObject jsonObject = aggregationsService.getIsLimitAggregationResult(paramMap, false);
Object islimitedAgg = jsonObject.get("islimitedAgg");
if (islimitedAgg != null && ((Boolean) islimitedAgg).booleanValue()) {
return "Y";
... ... @@ -194,10 +195,10 @@ public class ProductIndexService implements ApplicationEventPublisherAware {
}
public SearchApiResult aggSpecialoffer(Map<String, String> paramMap) {
return this.getSearchApiResult("aggSpecialoffer", paramMap, new ProductIndexService.Searcher() {
return this.getSearchApiResult("aggSpecialoffer", paramMap, new ProductIndexAggService.Searcher() {
@Override
public Object getResult() throws Exception {
JSONObject jsonObject = aggregationService.getIsSecialofferAggregationResult(paramMap, false);
JSONObject jsonObject = aggregationsService.getIsSecialofferAggregationResult(paramMap, false);
Object specialofferAgg = jsonObject.get("specialofferAgg");
if (specialofferAgg != null && ((Boolean) specialofferAgg).booleanValue()) {
return "Y";
... ... @@ -210,10 +211,10 @@ public class ProductIndexService implements ApplicationEventPublisherAware {
public SearchApiResult aggKeywords(Map<String, String> paramMap) {
final int randomKeywordCount = StringUtils.isBlank(paramMap.get("keyword_count")) ? 8 : Integer.parseInt(paramMap.get("keyword_count"));
return this.getSearchApiResult("aggKeywords", paramMap, new ProductIndexService.Searcher() {
return this.getSearchApiResult("aggKeywords", paramMap, new ProductIndexAggService.Searcher() {
@Override
public Object getResult() throws Exception {
JSONObject jsonObject = aggregationService.getKeywordAggregationResult(paramMap, 50);
JSONObject jsonObject = aggregationsService.getKeywordAggregationResult(paramMap, 50);
@SuppressWarnings("unchecked")
List<String> keywordList = (List<String>) jsonObject.get("keywordAgg");
return getRandomKeywords(keywordList, randomKeywordCount);
... ...
... ... @@ -16,7 +16,7 @@ import com.yoho.search.core.es.model.SearchParam;
import com.yoho.search.core.es.model.SearchResult;
import com.yoho.search.core.es.utils.IgnoreSomeException;
import com.yoho.search.models.SearchApiResult;
import com.yoho.search.service.scene.aggregations.impls.AggregationFactory;
import com.yoho.search.service.aggregations.impls.AggregationFactory;
import com.yoho.search.common.SearchCommonService;
import com.yoho.search.service.helper.SearchAfterCacheHelper;
import com.yoho.search.service.helper.SearchParamHelper;
... ...
... ... @@ -9,7 +9,7 @@ import com.yoho.search.core.es.model.SearchResult;
import com.yoho.search.models.RecommendPromotionAggVO;
import com.yoho.search.models.SearchApiResult;
import com.yoho.search.service.helper.SearchParamHelper;
import com.yoho.search.service.scene.aggregations.impls.AggregationFactory;
import com.yoho.search.service.aggregations.impls.AggregationFactory;
import com.yoho.search.common.SearchCommonService;
import com.yoho.search.service.index.promotion.PromotionIndexBaseService;
import org.elasticsearch.search.aggregations.Aggregation;
... ...
... ... @@ -9,7 +9,7 @@ import com.yoho.search.core.es.agg.IAggregation;
import com.yoho.search.core.es.model.SearchParam;
import com.yoho.search.core.es.model.SearchResult;
import com.yoho.search.models.SearchApiResult;
import com.yoho.search.service.scene.aggregations.impls.AggregationFactory;
import com.yoho.search.service.aggregations.impls.AggregationFactory;
import com.yoho.search.common.SearchCommonService;
import com.yoho.search.service.helper.SearchParamHelper;
import org.elasticsearch.index.query.BoolQueryBuilder;
... ...
... ... @@ -17,7 +17,7 @@ import com.yoho.search.core.es.agg.IAggregation;
import com.yoho.search.core.es.model.SearchParam;
import com.yoho.search.core.es.model.SearchResult;
import com.yoho.search.core.es.utils.IgnoreSomeException;
import com.yoho.search.service.scene.aggregations.impls.AggregationFactory;
import com.yoho.search.service.aggregations.impls.AggregationFactory;
import com.yoho.search.common.SearchCommonService;
import com.yoho.search.common.SearchRequestParams;
import com.yoho.search.service.helper.SearchCommonHelper;
... ...
... ... @@ -13,7 +13,7 @@ import com.yoho.search.common.utils.SearchApiResultUtils;
import com.yoho.search.core.es.agg.IAggregation;
import com.yoho.search.core.es.model.SearchParam;
import com.yoho.search.core.es.model.SearchResult;
import com.yoho.search.service.scene.aggregations.impls.AggregationFactory;
import com.yoho.search.service.aggregations.impls.AggregationFactory;
import com.yoho.search.common.SearchCommonService;
import com.yoho.search.service.index.BrandIndexBaseService;
import com.yoho.search.service.index.ColorIndexBaseService;
... ...
... ... @@ -12,7 +12,7 @@ import com.yoho.search.cache.model.SearchCache;
import com.yoho.search.core.es.agg.IAggregation;
import com.yoho.search.core.es.model.SearchParam;
import com.yoho.search.core.es.model.SearchResult;
import com.yoho.search.service.scene.aggregations.impls.AggregationFactory;
import com.yoho.search.service.aggregations.impls.AggregationFactory;
import com.yoho.search.common.SearchCommonService;
import com.yoho.search.common.SearchRequestParams;
import com.yoho.search.service.index.BrandIndexBaseService;
... ...
package com.yoho.search.service.scene.aggregations.impls;
import com.yoho.search.base.utils.ProductIndexEsField;
public class SmallSortNameAggregation extends AbstractSingleFieldAggregation {
public SmallSortNameAggregation(int count) {
super(count);
}
@Override
public String aggName() {
return "smallSortNameAgg";
}
@Override
public String filterName() {
return "smallSortName";
}
@Override
protected String getField() {
return ProductIndexEsField.smallSort_smallSort_keyword;
}
}
package com.yoho.search.service.scene.aggregations.impls;
import com.yoho.search.base.utils.ProductIndexEsField;
public class StyleNameAggregation extends AbstractSingleFieldAggregation {
public StyleNameAggregation(int count) {
super(count);
}
@Override
public String aggName() {
return "styleNameAgg";
}
@Override
public String filterName() {
return "styleName";
}
@Override
protected String getField() {
return ProductIndexEsField.style;
}
}
... ... @@ -15,8 +15,8 @@ import com.yoho.search.cache.model.SearchCache;
import com.yoho.search.common.utils.SearchApiResultUtils;
import com.yoho.search.core.es.agg.IAggregation;
import com.yoho.search.core.es.model.SearchParam;
import com.yoho.search.service.scene.aggregations.AggregationService;
import com.yoho.search.service.scene.aggregations.impls.AggregationFactory;
import com.yoho.search.service.aggregations.AggregationsService;
import com.yoho.search.service.aggregations.impls.AggregationFactory;
import com.yoho.search.common.SearchDynamicConfigService;
import com.yoho.search.common.SearchRequestParams;
import com.yoho.search.service.helper.SearchParamHelper;
... ... @@ -35,7 +35,7 @@ public class AggRecommendService extends AbstractCacheAbleService {
private static final int DEFAULT_AGGREGATION_COUNT = 100;
@Autowired
private AggregationService aggregationService;
private AggregationsService aggregationsService;
@Autowired
private AggregationFactory aggregationFactory;
@Autowired
... ... @@ -81,7 +81,7 @@ public class AggRecommendService extends AbstractCacheAbleService {
return new SearchApiResult().setData(cacheJSONArray);
}
// 6、从ES中获取
JSONObject recommendBrandResult = aggregationService.getAggNameAndResponse(recommendBrandAgg, searchParam);
JSONObject recommendBrandResult = aggregationsService.getAggNameAndResponse(recommendBrandAgg, searchParam);
if (recommendBrandResult == null) {
return new SearchApiResult().setData(500).setMessage("exception");
}
... ... @@ -133,7 +133,7 @@ public class AggRecommendService extends AbstractCacheAbleService {
return this.getRecommendShopSearchApiResult(cacheJSONArray, page, count);
}
// 6、从ES中获取
JSONObject recommendShopResult = aggregationService.getAggNameAndResponse(recommendShopAgg, searchParam);
JSONObject recommendShopResult = aggregationsService.getAggNameAndResponse(recommendShopAgg, searchParam);
if (recommendShopResult == null) {
return new SearchApiResult().setData(500).setMessage("exception");
}
... ...
... ... @@ -18,8 +18,8 @@ import com.yoho.search.core.es.agg.IAggregation;
import com.yoho.search.core.es.model.SearchParam;
import com.yoho.search.core.es.model.SearchResult;
import com.yoho.search.core.es.utils.IgnoreSomeException;
import com.yoho.search.service.scene.aggregations.AggregationService;
import com.yoho.search.service.scene.aggregations.impls.AggregationFactory;
import com.yoho.search.service.aggregations.AggregationsService;
import com.yoho.search.service.aggregations.impls.AggregationFactory;
import com.yoho.search.common.SearchCommonService;
import com.yoho.search.common.SearchRequestParams;
import com.yoho.search.service.index.BrandIndexBaseService;
... ... @@ -66,7 +66,7 @@ public class BrandService extends AbstractCacheAbleService implements Applicatio
@Autowired
private SearchParamHelper searchParamHelper;
@Autowired
private AggregationService aggregationService;
private AggregationsService aggregationsService;
@Autowired
private SearchCommonService searchCommonService;
@Autowired
... ... @@ -117,7 +117,7 @@ public class BrandService extends AbstractCacheAbleService implements Applicatio
return new SearchApiResult().setData(cacheJSONArray);
}
// 4、从ES中获取
JSONObject jsonObject = aggregationService.getAggNameAndResponse(brandAggregation, searchParam);
JSONObject jsonObject = aggregationsService.getAggNameAndResponse(brandAggregation, searchParam);
if (jsonObject == null) {
return new SearchApiResult().setData(500).setMessage("exception");
}
... ... @@ -276,7 +276,7 @@ public class BrandService extends AbstractCacheAbleService implements Applicatio
searchParam.setSize(0);
// 4、从ES中获取
JSONObject groupBrandResult = aggregationService.getAggNameAndResponseWithTotal(groupBrandAgg, searchParam);
JSONObject groupBrandResult = aggregationsService.getAggNameAndResponseWithTotal(groupBrandAgg, searchParam);
if (groupBrandResult == null) {
return new SearchApiResult().setData(500).setMessage("exception");
}
... ...
... ... @@ -14,8 +14,8 @@ import com.yoho.search.core.es.model.SearchParam;
import com.yoho.search.core.es.model.SearchResult;
import com.yoho.search.core.es.utils.IgnoreSomeException;
import com.yoho.search.models.SearchApiResult;
import com.yoho.search.service.scene.aggregations.AggregationService;
import com.yoho.search.service.scene.aggregations.impls.AggregationFactory;
import com.yoho.search.service.aggregations.AggregationsService;
import com.yoho.search.service.aggregations.impls.AggregationFactory;
import com.yoho.search.common.SearchCommonService;
import com.yoho.search.common.SearchRequestParams;
import com.yoho.search.service.helper.SearchParamHelper;
... ... @@ -48,7 +48,7 @@ public class ShopsService extends BaseService implements ApplicationEventPublish
@Autowired
private ShopListService shopListService;
@Autowired
private AggregationService aggregationService;
private AggregationsService aggregationsService;
@Autowired
private AggregationFactory aggregationFactory;
@Autowired
... ... @@ -75,7 +75,7 @@ public class ShopsService extends BaseService implements ApplicationEventPublish
searchParam.setOffset(0);
searchParam.setSize(0);
// 4、从ES中获取
JSONObject aggNameAndResponse = aggregationService.getAggNameAndResponseWithTotal(groupShopAgg, searchParam);
JSONObject aggNameAndResponse = aggregationsService.getAggNameAndResponseWithTotal(groupShopAgg, searchParam);
if (aggNameAndResponse == null) {
return new SearchApiResult().setData(500).setMessage("exception");
}
... ...
... ... @@ -7,7 +7,7 @@ import com.yoho.search.common.utils.SearchApiResultUtils;
import com.yoho.search.models.SearchApiResult;
import com.yoho.search.service.helper.SearchCommonHelper;
import com.yoho.search.service.helper.SearchKeyWordHelper;
import com.yoho.search.service.scene.aggregations.AggregationService;
import com.yoho.search.service.aggregations.AggregationsService;
import com.yoho.search.service.scene.common.BaseSceneService;
import com.yoho.search.service.scene.list.ProductListSwitchService;
import org.apache.commons.lang3.StringUtils;
... ... @@ -22,7 +22,7 @@ public class SearchHongRenService extends BaseSceneService {
@Autowired
protected SearchCacheService searchCacheService;
@Autowired
private AggregationService aggregationService;
private AggregationsService aggregationsService;
@Autowired
private ProductListSwitchService productListSwitchService;
@Autowired
... ... @@ -42,7 +42,7 @@ public class SearchHongRenService extends BaseSceneService {
}
SearchApiResult searchApiResult = new SearchApiResult().setCode(200).setMessage("Shop product List .");
try {
JSONObject dataMap = aggregationService.getShopAndSknAggregationResult(paramMap, page, pageSize, 10000);
JSONObject dataMap = aggregationsService.getShopAndSknAggregationResult(paramMap, page, pageSize, 10000);
searchApiResult.setData(dataMap);
} catch (Exception e) {
return new SearchApiResult().setData(null).setMessage("ShopProductList Exception").setCode(500);
... ...
... ... @@ -26,7 +26,7 @@ import com.yoho.search.core.es.model.SearchParam;
import com.yoho.search.core.es.model.SearchResult;
import com.yoho.search.models.PromotionConditions;
import com.yoho.search.models.SearchApiResult;
import com.yoho.search.service.scene.aggregations.impls.AggregationFactory;
import com.yoho.search.service.aggregations.impls.AggregationFactory;
import com.yoho.search.common.SearchCommonService;
import com.yoho.search.service.helper.SearchAfterCacheHelper;
import com.yoho.search.service.helper.SearchParamHelper;
... ...