...
|
...
|
@@ -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();
|
|
|
}
|
...
|
...
|
|