Bläddra i källkod

根据维度编码查询维度 类型

jkzlzhoujie 6 år sedan
förälder
incheckning
fce73fd12e
1 ändrade filer med 6 tillägg och 0 borttagningar
  1. 6 0
      src/main/java/com/yihu/quota/util/AggregationBuildHandler.java

+ 6 - 0
src/main/java/com/yihu/quota/util/AggregationBuildHandler.java

@ -19,7 +19,9 @@ import org.elasticsearch.index.query.QueryBuilder;
import org.elasticsearch.search.aggregations.AbstractAggregationBuilder;
import org.elasticsearch.search.aggregations.Aggregation;
import org.elasticsearch.search.aggregations.AggregationBuilders;
import org.elasticsearch.search.aggregations.InternalAggregations;
import org.elasticsearch.search.aggregations.bucket.filter.FilterAggregationBuilder;
import org.elasticsearch.search.aggregations.bucket.filter.InternalFilter;
import org.elasticsearch.search.aggregations.bucket.terms.*;
import org.elasticsearch.search.aggregations.metrics.avg.InternalAvg;
import org.elasticsearch.search.aggregations.metrics.max.InternalMax;
@ -410,6 +412,10 @@ public class AggregationBuildHandler {
        }else if (aggregation instanceof InternalAvg) {
            InternalAvg valueCount = (InternalAvg) aggregation;
            value = valueCount.getValue();
        }else if (aggregation instanceof InternalFilter) {
            InternalFilter internalFilter = (InternalFilter) aggregation;
            List<Aggregation> aggregationList = internalFilter.getAggregations().asList();
            value = getInternalAggValue(key,aggregationList.get(0));
        }
        if(value != null){
            map.put(key, value);