Authored by 胡古飞

remove invalidate code

... ... @@ -6,7 +6,6 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.yoho.search.core.es.agg.IAggregation;
import com.yoho.search.service.aggregations.AggInterface;
import com.yoho.search.service.service.SearchCommonService;
import com.yoho.search.service.service.base.BrandIndexBaseService;
import com.yoho.search.service.service.base.ColorIndexBaseService;
... ... @@ -24,56 +23,9 @@ public class AggregationFactoryService {
private BrandIndexBaseService brandIndexBaseService;
@Autowired
private ColorIndexBaseService colorIndexBaseService;
@Autowired
private IShopsService shopsService;
public IAggregation getSubAggregationByType(int type, Map<String, String> paramMap) {
IAggregation iAggregation = null;
switch (type) {
case AggInterface.AGE_LEVEL:
iAggregation = new AgeLevelAggregation();
break;
case AggInterface.DISCOUNT:
iAggregation = new DiscountAggregation();
break;
case AggInterface.GENDER:
iAggregation = new GenderAggregation(paramMap);
break;
case AggInterface.PRICE:
iAggregation = new PriceAggregation(searchAfterCacheService);
break;
case AggInterface.COLOR:
iAggregation = new ColorAggregation(colorIndexBaseService, paramMap);
break;
case AggInterface.STYLE:
iAggregation = new StyleAggregation(searchCommonService, paramMap);
break;
case AggInterface.BRAND:
iAggregation = new BrandAggregation(brandIndexBaseService, paramMap);
break;
case AggInterface.SIZE:
iAggregation = new SizeAggregation(searchCommonService);
break;
case AggInterface.STANDARD:
iAggregation = new StandardAggregation(searchCommonService, paramMap);
break;
case AggInterface.RECENT_SHELVE_DAY:
iAggregation = new RecentShelveDayAggregation();
break;
case AggInterface.IS_NEW:
iAggregation = new IsNewAggregation();
break;
case AggInterface.IS_LIMITED:
iAggregation = new IsLimitedAggregation();
break;
case AggInterface.IS_SPECIAL:
iAggregation = new IsSecialofferAggregation();
break;
}
return iAggregation;
}
public IAggregation getAgeLevelAggregation() {
return new AgeLevelAggregation();
}
... ...
... ... @@ -19,7 +19,6 @@ 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.aggregations.AggInterface;
import com.yoho.search.service.aggregations.impls.AggregationFactoryService;
import com.yoho.search.service.service.SearchCacheService;
import com.yoho.search.service.service.SearchCommonService;
... ... @@ -77,7 +76,7 @@ public class DiscountServiceImpl implements IDiscountService, ApplicationEventPu
searchParam.setFiter(searchServiceHelper.constructFilterBuilder(paramMap, null));
// 按1-3,4-6,7-10折的规则进行聚合[按区间聚合]
IAggregation discountAggregation = aggregationFactoryService.getSubAggregationByType(AggInterface.DISCOUNT, null);
IAggregation discountAggregation = aggregationFactoryService.getDiscountAggregation();
searchParam.setAggregationBuilders(Arrays.asList(discountAggregation.getBuilder()));
searchParam.setSize(0);
... ... @@ -124,7 +123,7 @@ public class DiscountServiceImpl implements IDiscountService, ApplicationEventPu
searchParam.setFiter(boolQueryBuilder);
// 按1-3,4-6,7-10折的规则进行聚合[按区间聚合]
IAggregation discountAggregation = aggregationFactoryService.getSubAggregationByType(AggInterface.DISCOUNT, null);
IAggregation discountAggregation = aggregationFactoryService.getDiscountAggregation();
searchParam.setAggregationBuilders(Arrays.asList(discountAggregation.getBuilder()));
searchParam.setSize(0);
... ...