|
@@ -6,7 +6,6 @@ import org.springframework.beans.factory.annotation.Autowired; |
|
@@ -6,7 +6,6 @@ import org.springframework.beans.factory.annotation.Autowired; |
6
|
import org.springframework.stereotype.Service;
|
6
|
import org.springframework.stereotype.Service;
|
7
|
|
7
|
|
8
|
import com.yoho.search.core.es.agg.IAggregation;
|
8
|
import com.yoho.search.core.es.agg.IAggregation;
|
9
|
-import com.yoho.search.service.aggregations.AggInterface;
|
|
|
10
|
import com.yoho.search.service.service.SearchCommonService;
|
9
|
import com.yoho.search.service.service.SearchCommonService;
|
11
|
import com.yoho.search.service.service.base.BrandIndexBaseService;
|
10
|
import com.yoho.search.service.service.base.BrandIndexBaseService;
|
12
|
import com.yoho.search.service.service.base.ColorIndexBaseService;
|
11
|
import com.yoho.search.service.service.base.ColorIndexBaseService;
|
|
@@ -24,56 +23,9 @@ public class AggregationFactoryService { |
|
@@ -24,56 +23,9 @@ public class AggregationFactoryService { |
24
|
private BrandIndexBaseService brandIndexBaseService;
|
23
|
private BrandIndexBaseService brandIndexBaseService;
|
25
|
@Autowired
|
24
|
@Autowired
|
26
|
private ColorIndexBaseService colorIndexBaseService;
|
25
|
private ColorIndexBaseService colorIndexBaseService;
|
27
|
-
|
|
|
28
|
@Autowired
|
26
|
@Autowired
|
29
|
private IShopsService shopsService;
|
27
|
private IShopsService shopsService;
|
30
|
|
28
|
|
31
|
- public IAggregation getSubAggregationByType(int type, Map<String, String> paramMap) {
|
|
|
32
|
- IAggregation iAggregation = null;
|
|
|
33
|
- switch (type) {
|
|
|
34
|
- case AggInterface.AGE_LEVEL:
|
|
|
35
|
- iAggregation = new AgeLevelAggregation();
|
|
|
36
|
- break;
|
|
|
37
|
- case AggInterface.DISCOUNT:
|
|
|
38
|
- iAggregation = new DiscountAggregation();
|
|
|
39
|
- break;
|
|
|
40
|
- case AggInterface.GENDER:
|
|
|
41
|
- iAggregation = new GenderAggregation(paramMap);
|
|
|
42
|
- break;
|
|
|
43
|
- case AggInterface.PRICE:
|
|
|
44
|
- iAggregation = new PriceAggregation(searchAfterCacheService);
|
|
|
45
|
- break;
|
|
|
46
|
- case AggInterface.COLOR:
|
|
|
47
|
- iAggregation = new ColorAggregation(colorIndexBaseService, paramMap);
|
|
|
48
|
- break;
|
|
|
49
|
- case AggInterface.STYLE:
|
|
|
50
|
- iAggregation = new StyleAggregation(searchCommonService, paramMap);
|
|
|
51
|
- break;
|
|
|
52
|
- case AggInterface.BRAND:
|
|
|
53
|
- iAggregation = new BrandAggregation(brandIndexBaseService, paramMap);
|
|
|
54
|
- break;
|
|
|
55
|
- case AggInterface.SIZE:
|
|
|
56
|
- iAggregation = new SizeAggregation(searchCommonService);
|
|
|
57
|
- break;
|
|
|
58
|
- case AggInterface.STANDARD:
|
|
|
59
|
- iAggregation = new StandardAggregation(searchCommonService, paramMap);
|
|
|
60
|
- break;
|
|
|
61
|
- case AggInterface.RECENT_SHELVE_DAY:
|
|
|
62
|
- iAggregation = new RecentShelveDayAggregation();
|
|
|
63
|
- break;
|
|
|
64
|
- case AggInterface.IS_NEW:
|
|
|
65
|
- iAggregation = new IsNewAggregation();
|
|
|
66
|
- break;
|
|
|
67
|
- case AggInterface.IS_LIMITED:
|
|
|
68
|
- iAggregation = new IsLimitedAggregation();
|
|
|
69
|
- break;
|
|
|
70
|
- case AggInterface.IS_SPECIAL:
|
|
|
71
|
- iAggregation = new IsSecialofferAggregation();
|
|
|
72
|
- break;
|
|
|
73
|
- }
|
|
|
74
|
- return iAggregation;
|
|
|
75
|
- }
|
|
|
76
|
-
|
|
|
77
|
public IAggregation getAgeLevelAggregation() {
|
29
|
public IAggregation getAgeLevelAggregation() {
|
78
|
return new AgeLevelAggregation();
|
30
|
return new AgeLevelAggregation();
|
79
|
}
|
31
|
}
|