Authored by 胡古飞

FIX IsSecialofferAggregation

@@ -27,7 +27,7 @@ public class IsLimitedAggregation extends AbstractAggregation { @@ -27,7 +27,7 @@ public class IsLimitedAggregation extends AbstractAggregation {
27 public Object getAggregationResponseMap(Map<String, Aggregation> aggMaps) { 27 public Object getAggregationResponseMap(Map<String, Aggregation> aggMaps) {
28 MultiBucketsAggregation aggregation = this.getAggregation(aggMaps); 28 MultiBucketsAggregation aggregation = this.getAggregation(aggMaps);
29 if (aggregation == null) { 29 if (aggregation == null) {
30 - return Boolean.FALSE; 30 + return null;
31 } 31 }
32 Iterator<? extends Bucket> itAgg = aggregation.getBuckets().iterator(); 32 Iterator<? extends Bucket> itAgg = aggregation.getBuckets().iterator();
33 while (itAgg.hasNext()) { 33 while (itAgg.hasNext()) {
1 package com.yoho.search.service.aggregations.impls; 1 package com.yoho.search.service.aggregations.impls;
2 2
3 import com.yoho.search.core.es.agg.AbstractAggregation; 3 import com.yoho.search.core.es.agg.AbstractAggregation;
  4 +
4 import org.elasticsearch.search.aggregations.AbstractAggregationBuilder; 5 import org.elasticsearch.search.aggregations.AbstractAggregationBuilder;
5 import org.elasticsearch.search.aggregations.Aggregation; 6 import org.elasticsearch.search.aggregations.Aggregation;
6 import org.elasticsearch.search.aggregations.AggregationBuilders; 7 import org.elasticsearch.search.aggregations.AggregationBuilders;
@@ -33,10 +34,10 @@ public class IsNewAggregation extends AbstractAggregation { @@ -33,10 +34,10 @@ public class IsNewAggregation extends AbstractAggregation {
33 Bucket bucket = itAgg.next(); 34 Bucket bucket = itAgg.next();
34 String bool = bucket.getKeyAsString(); 35 String bool = bucket.getKeyAsString();
35 if ("Y".equals(bool)) { 36 if ("Y".equals(bool)) {
36 - return true; 37 + return Boolean.TRUE;
37 } 38 }
38 } 39 }
39 - return false; 40 + return Boolean.FALSE;
40 } 41 }
41 42
42 } 43 }
1 package com.yoho.search.service.aggregations.impls; 1 package com.yoho.search.service.aggregations.impls;
2 2
3 import com.yoho.search.core.es.agg.AbstractAggregation; 3 import com.yoho.search.core.es.agg.AbstractAggregation;
  4 +
4 import org.elasticsearch.search.aggregations.AbstractAggregationBuilder; 5 import org.elasticsearch.search.aggregations.AbstractAggregationBuilder;
5 import org.elasticsearch.search.aggregations.Aggregation; 6 import org.elasticsearch.search.aggregations.Aggregation;
6 import org.elasticsearch.search.aggregations.AggregationBuilders; 7 import org.elasticsearch.search.aggregations.AggregationBuilders;
@@ -33,9 +34,9 @@ public class IsSecialofferAggregation extends AbstractAggregation { @@ -33,9 +34,9 @@ public class IsSecialofferAggregation extends AbstractAggregation {
33 Bucket bucket = itAgg.next(); 34 Bucket bucket = itAgg.next();
34 String bool = bucket.getKeyAsString(); 35 String bool = bucket.getKeyAsString();
35 if ("Y".equals(bool)) { 36 if ("Y".equals(bool)) {
36 - return true; 37 + return Boolean.TRUE;
37 } 38 }
38 } 39 }
39 - return false; 40 + return Boolean.FALSE;
40 } 41 }
41 } 42 }