Authored by 胡古飞

FIX IsSecialofferAggregation

... ... @@ -27,7 +27,7 @@ public class IsLimitedAggregation extends AbstractAggregation {
public Object getAggregationResponseMap(Map<String, Aggregation> aggMaps) {
MultiBucketsAggregation aggregation = this.getAggregation(aggMaps);
if (aggregation == null) {
return Boolean.FALSE;
return null;
}
Iterator<? extends Bucket> itAgg = aggregation.getBuckets().iterator();
while (itAgg.hasNext()) {
... ...
package com.yoho.search.service.aggregations.impls;
import com.yoho.search.core.es.agg.AbstractAggregation;
import org.elasticsearch.search.aggregations.AbstractAggregationBuilder;
import org.elasticsearch.search.aggregations.Aggregation;
import org.elasticsearch.search.aggregations.AggregationBuilders;
... ... @@ -21,7 +22,7 @@ public class IsNewAggregation extends AbstractAggregation {
public AbstractAggregationBuilder getBuilder() {
return AggregationBuilders.terms(aggName()).field("isnew").size(2);
}
@Override
public Object getAggregationResponseMap(Map<String, Aggregation> aggMaps) {
MultiBucketsAggregation aggregation = this.getAggregation(aggMaps);
... ... @@ -33,10 +34,10 @@ public class IsNewAggregation extends AbstractAggregation {
Bucket bucket = itAgg.next();
String bool = bucket.getKeyAsString();
if ("Y".equals(bool)) {
return true;
return Boolean.TRUE;
}
}
return false;
return Boolean.FALSE;
}
}
... ...
package com.yoho.search.service.aggregations.impls;
import com.yoho.search.core.es.agg.AbstractAggregation;
import org.elasticsearch.search.aggregations.AbstractAggregationBuilder;
import org.elasticsearch.search.aggregations.Aggregation;
import org.elasticsearch.search.aggregations.AggregationBuilders;
... ... @@ -33,9 +34,9 @@ public class IsSecialofferAggregation extends AbstractAggregation {
Bucket bucket = itAgg.next();
String bool = bucket.getKeyAsString();
if ("Y".equals(bool)) {
return true;
return Boolean.TRUE;
}
}
return false;
return Boolean.FALSE;
}
}
... ...