Authored by Gino Zhang

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

... ... @@ -69,7 +69,7 @@ public class BrandWithSortNameSuggestionDiscoverer extends AbstractSuggestionDis
Iterator<? extends MultiBucketsAggregation.Bucket> bucketIterator = aggregation.getBuckets().iterator();
while (bucketIterator.hasNext()) {
MultiBucketsAggregation.Bucket brandBucket = bucketIterator.next();
Integer brandId = (Integer) brandBucket.getKey();
Integer brandId = Integer.valueOf(brandBucket.getKeyAsString());
if (!brandNameMap.containsKey(brandId)) {
continue;
}
... ... @@ -80,7 +80,7 @@ public class BrandWithSortNameSuggestionDiscoverer extends AbstractSuggestionDis
Iterator<? extends MultiBucketsAggregation.Bucket> smallSortBucketIterator = smallSortAgg.getBuckets().iterator();
while (smallSortBucketIterator.hasNext()) {
MultiBucketsAggregation.Bucket smallSortBucket = smallSortBucketIterator.next();
Integer smallSortId = (Integer) smallSortBucket.getKey();
Integer smallSortId = Integer.valueOf(smallSortBucket.getKeyAsString());
if (sortNameMap.containsKey(smallSortId)) {
brandNameSet.add(brandName + " " + sortNameMap.get(smallSortId));
}
... ...