Authored by Gino Zhang

搜索建议词增加品牌+小品类 从ES聚合获取

@@ -76,7 +76,7 @@ public class BrandWithSortNameSuggestionDiscoverer extends AbstractSuggestionDis @@ -76,7 +76,7 @@ public class BrandWithSortNameSuggestionDiscoverer extends AbstractSuggestionDis
76 76
77 String brandName = brandNameMap.get(brandId); 77 String brandName = brandNameMap.get(brandId);
78 if (brandBucket.getAggregations() != null && brandBucket.getAggregations().get("smallSortAgg") != null) { 78 if (brandBucket.getAggregations() != null && brandBucket.getAggregations().get("smallSortAgg") != null) {
79 - MultiBucketsAggregation smallSortAgg = (MultiBucketsAggregation) searchResult.getAggMaps().get("smallSortAgg"); 79 + MultiBucketsAggregation smallSortAgg = brandBucket.getAggregations().get("smallSortAgg");
80 Iterator<? extends MultiBucketsAggregation.Bucket> smallSortBucketIterator = smallSortAgg.getBuckets().iterator(); 80 Iterator<? extends MultiBucketsAggregation.Bucket> smallSortBucketIterator = smallSortAgg.getBuckets().iterator();
81 while (smallSortBucketIterator.hasNext()) { 81 while (smallSortBucketIterator.hasNext()) {
82 MultiBucketsAggregation.Bucket smallSortBucket = smallSortBucketIterator.next(); 82 MultiBucketsAggregation.Bucket smallSortBucket = smallSortBucketIterator.next();