org.elasticsearch.search.aggregations.pipeline.PipelineAggregator Java Examples

The following examples show how to use org.elasticsearch.search.aggregations.pipeline.PipelineAggregator. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: BucketScriptBuilder.java    From Elasticsearch with Apache License 2.0 6 votes vote down vote up
@Override
protected XContentBuilder internalXContent(XContentBuilder builder, Params builderParams) throws IOException {
    if (script != null) {
        builder.field(ScriptField.SCRIPT.getPreferredName(), script);
    }
    if (format != null) {
        builder.field(BucketScriptParser.FORMAT.getPreferredName(), format);
    }
    if (gapPolicy != null) {
        builder.field(BucketScriptParser.GAP_POLICY.getPreferredName(), gapPolicy.getName());
    }
    if (bucketsPathsMap != null) {
        builder.field(PipelineAggregator.Parser.BUCKETS_PATH.getPreferredName(), bucketsPathsMap);
    }
    return builder;
}
 
Example #2
Source File: TermsAggregatorFactory.java    From Elasticsearch with Apache License 2.0 6 votes vote down vote up
@Override
Aggregator create(String name, AggregatorFactories factories, ValuesSource valuesSource, Terms.Order order,
        TermsAggregator.BucketCountThresholds bucketCountThresholds, IncludeExclude includeExclude,
        AggregationContext aggregationContext, Aggregator parent, SubAggCollectionMode subAggCollectMode,
        boolean showTermDocCountError, List<PipelineAggregator> pipelineAggregators, Map<String, Object> metaData)
        throws IOException {
    if (includeExclude != null || factories.count() > 0
            // we need the FieldData impl to be able to extract the
            // segment to global ord mapping
            || valuesSource.getClass() != ValuesSource.Bytes.FieldData.class) {
        return GLOBAL_ORDINALS.create(name, factories, valuesSource, order, bucketCountThresholds, includeExclude,
                aggregationContext, parent, subAggCollectMode, showTermDocCountError, pipelineAggregators, metaData);
    }
    return new GlobalOrdinalsStringTermsAggregator.LowCardinality(name, factories,
            (ValuesSource.Bytes.WithOrdinals) valuesSource, order, bucketCountThresholds, aggregationContext, parent,
            subAggCollectMode, showTermDocCountError, pipelineAggregators, metaData);
}
 
Example #3
Source File: StatsAggregator.java    From Elasticsearch with Apache License 2.0 6 votes vote down vote up
public StatsAggregator(String name, ValuesSource.Numeric valuesSource, ValueFormatter formatter,
                       AggregationContext context,
                       Aggregator parent, List<PipelineAggregator> pipelineAggregators,
                       Map<String, Object> metaData) throws IOException {
    super(name, context, parent, pipelineAggregators, metaData);
    this.valuesSource = valuesSource;
    if (valuesSource != null) {
        final BigArrays bigArrays = context.bigArrays();
        counts = bigArrays.newLongArray(1, true);
        sums = bigArrays.newDoubleArray(1, true);
        mins = bigArrays.newDoubleArray(1, false);
        mins.fill(0, mins.size(), Double.POSITIVE_INFINITY);
        maxes = bigArrays.newDoubleArray(1, false);
        maxes.fill(0, maxes.size(), Double.NEGATIVE_INFINITY);
    }
    this.formatter = formatter;
}
 
Example #4
Source File: TermsAggregatorFactory.java    From Elasticsearch with Apache License 2.0 6 votes vote down vote up
@Override
protected Aggregator createUnmapped(AggregationContext aggregationContext, Aggregator parent,
        List<PipelineAggregator> pipelineAggregators, Map<String, Object> metaData) throws IOException {
    final InternalAggregation aggregation = new UnmappedTerms(name, order, bucketCountThresholds.getRequiredSize(),
            bucketCountThresholds.getShardSize(), bucketCountThresholds.getMinDocCount(), pipelineAggregators, metaData);
    return new NonCollectingAggregator(name, aggregationContext, parent, factories, pipelineAggregators, metaData) {
        {
            // even in the case of an unmapped aggregator, validate the order
            InternalOrder.validate(order, this);
        }

        @Override
        public InternalAggregation buildEmptyAggregation() {
            return aggregation;
        }
    };
}
 
Example #5
Source File: DateHierarchyAggregatorFactory.java    From elasticsearch-aggregation-pathhierarchy with MIT License 6 votes vote down vote up
@Override
protected Aggregator createUnmapped(
        SearchContext searchContext,
        Aggregator parent,
        List<PipelineAggregator> pipelineAggregators,
        Map<String,
        Object> metaData) throws IOException {
    final InternalAggregation aggregation = new InternalDateHierarchy(name, new ArrayList<>(), order, minDocCount,
            bucketCountThresholds.getRequiredSize(), bucketCountThresholds.getShardSize(), 0, pipelineAggregators, metaData);
    return new NonCollectingAggregator(name, searchContext, parent, factories, pipelineAggregators, metaData) {
        {
            // even in the case of an unmapped aggregator, validate the
            // order
            InternalOrder.validate(order, this);
        }

        @Override
        public InternalAggregation buildEmptyAggregation() { return aggregation; }
    };
}
 
Example #6
Source File: HistogramAggregator.java    From Elasticsearch with Apache License 2.0 6 votes vote down vote up
public HistogramAggregator(String name, AggregatorFactories factories, Rounding rounding, InternalOrder order, boolean keyed,
        long minDocCount, @Nullable ExtendedBounds extendedBounds, @Nullable ValuesSource.Numeric valuesSource,
        ValueFormatter formatter, InternalHistogram.Factory<?> histogramFactory, AggregationContext aggregationContext,
        Aggregator parent, List<PipelineAggregator> pipelineAggregators, Map<String, Object> metaData) throws IOException {

    super(name, factories, aggregationContext, parent, pipelineAggregators, metaData);
    this.rounding = rounding;
    this.order = order;
    this.keyed = keyed;
    this.minDocCount = minDocCount;
    this.extendedBounds = extendedBounds;
    this.valuesSource = valuesSource;
    this.formatter = formatter;
    this.histogramFactory = histogramFactory;

    bucketOrds = new LongHash(1, aggregationContext.bigArrays());
}
 
Example #7
Source File: MultiValuesSourceAggregatorFactory.java    From elasticsearch-linear-regression with Apache License 2.0 6 votes vote down vote up
@Override
public Aggregator createInternal(Aggregator parent, boolean collectsFromSingleBucket,
    List<PipelineAggregator> pipelineAggregators,
    Map<String, Object> metaData) throws IOException {
  List<NamedValuesSourceSpec<VS>> valuesSources = new ArrayList<>();

  for (NamedValuesSourceConfigSpec<VS> config : configs) {
    VS vs = config.getConfig().toValuesSource(context.getQueryShardContext());
    if (vs != null) {
      valuesSources.add(new NamedValuesSourceSpec<>(config.getName(), vs));
    }
  }
  if (valuesSources.isEmpty()) {
    return createUnmapped(parent, pipelineAggregators, metaData);
  }
  return doCreateInternal(valuesSources, parent, collectsFromSingleBucket, pipelineAggregators,
      metaData);
}
 
Example #8
Source File: PathHierarchyAggregator.java    From elasticsearch-aggregation-pathhierarchy with MIT License 6 votes vote down vote up
public PathHierarchyAggregator(
        String name,
        AggregatorFactories factories,
        SearchContext context,
        ValuesSource valuesSource,
        BucketOrder order,
        long minDocCount,
        BucketCountThresholds bucketCountThresholds,
        BytesRef separator,
        int minDepth,
        Aggregator parent,
        List<PipelineAggregator> pipelineAggregators,
        Map<String, Object> metaData
) throws IOException {
    super(name, factories, context, parent, pipelineAggregators, metaData);
    this.valuesSource = valuesSource;
    this.separator = separator;
    this.minDocCount = minDocCount;
    bucketOrds = new BytesRefHash(1, context.bigArrays());
    this.order = InternalOrder.validate(order, this);
    this.bucketCountThresholds = bucketCountThresholds;
    this.minDepth = minDepth;
}
 
Example #9
Source File: InternalAggregation.java    From Elasticsearch with Apache License 2.0 6 votes vote down vote up
@Override
public final void readFrom(StreamInput in) throws IOException {
    name = in.readString();
    metaData = in.readMap();
    int size = in.readVInt();
    if (size == 0) {
        pipelineAggregators = Collections.emptyList();
    } else {
        pipelineAggregators = new ArrayList<>(size);
        for (int i = 0; i < size; i++) {
            BytesReference type = in.readBytesReference();
            PipelineAggregator pipelineAggregator = PipelineAggregatorStreams.stream(type).readResult(in);
            pipelineAggregators.add(pipelineAggregator);
        }
    }
    doReadFrom(in);
}
 
Example #10
Source File: FiltersAggregator.java    From Elasticsearch with Apache License 2.0 6 votes vote down vote up
public FiltersAggregator(String name, AggregatorFactories factories, String[] keys, Weight[] filters, boolean keyed, String otherBucketKey,
        AggregationContext aggregationContext,
        Aggregator parent, List<PipelineAggregator> pipelineAggregators, Map<String, Object> metaData)
        throws IOException {
    super(name, factories, aggregationContext, parent, pipelineAggregators, metaData);
    this.keyed = keyed;
    this.keys = keys;
    this.filters = filters;
    this.showOtherBucket = otherBucketKey != null;
    this.otherBucketKey = otherBucketKey;
    if (showOtherBucket) {
        this.totalNumKeys = keys.length + 1;
    } else {
        this.totalNumKeys = keys.length;
    }
}
 
Example #11
Source File: ReverseNestedAggregator.java    From Elasticsearch with Apache License 2.0 6 votes vote down vote up
@Override
public Aggregator createInternal(AggregationContext context, Aggregator parent, boolean collectsFromSingleBucket,
        List<PipelineAggregator> pipelineAggregators, Map<String, Object> metaData) throws IOException {
    // Early validation
    NestedAggregator closestNestedAggregator = findClosestNestedAggregator(parent);
    if (closestNestedAggregator == null) {
        throw new SearchParseException(context.searchContext(), "Reverse nested aggregation [" + name
                + "] can only be used inside a [nested] aggregation", null);
    }

    final ObjectMapper objectMapper;
    if (path != null) {
        objectMapper = context.searchContext().getObjectMapper(path);
        if (objectMapper == null) {
            return new Unmapped(name, context, parent, pipelineAggregators, metaData);
        }
        if (!objectMapper.nested().isNested()) {
            throw new AggregationExecutionException("[reverse_nested] nested path [" + path + "] is not nested");
        }
    } else {
        objectMapper = null;
    }
    return new ReverseNestedAggregator(name, factories, objectMapper, context, parent, pipelineAggregators, metaData);
}
 
Example #12
Source File: PathHierarchyAggregatorFactory.java    From elasticsearch-aggregation-pathhierarchy with MIT License 6 votes vote down vote up
@Override
protected Aggregator doCreateInternal(
        ValuesSource valuesSource, SearchContext searchContext, Aggregator parent,
        boolean collectsFromSingleBucket, List<PipelineAggregator> pipelineAggregators,
        Map<String, Object> metaData) throws IOException {

    ValuesSource valuesSourceBytes = new HierarchyValuesSource(valuesSource, separator, minDepth, maxDepth, keepBlankPath);
    PathHierarchyAggregator.BucketCountThresholds bucketCountThresholds = new
            PathHierarchyAggregator.BucketCountThresholds(this.bucketCountThresholds);
    if (!InternalOrder.isKeyOrder(order)
            && bucketCountThresholds.getShardSize() == PathHierarchyAggregationBuilder.DEFAULT_BUCKET_COUNT_THRESHOLDS.getShardSize()) {
        // The user has not made a shardSize selection. Use default
        // heuristic to avoid any wrong-ranking caused by distributed
        // counting
        bucketCountThresholds.setShardSize(BucketUtils.suggestShardSideQueueSize(bucketCountThresholds.getRequiredSize()));
    }
    bucketCountThresholds.ensureValidity();
    return new PathHierarchyAggregator(
            name, factories, searchContext,
            valuesSourceBytes, order, minDocCount, bucketCountThresholds, separator, minDepth,
            parent, pipelineAggregators, metaData);
}
 
Example #13
Source File: CumulativeSumPipelineAggregator.java    From Elasticsearch with Apache License 2.0 6 votes vote down vote up
@Override
public void doValidate(AggregatorFactory parent, AggregatorFactory[] aggFactories, List<PipelineAggregatorFactory> pipelineAggregatorFactories) {
    if (bucketsPaths.length != 1) {
        throw new IllegalStateException(PipelineAggregator.Parser.BUCKETS_PATH.getPreferredName()
                + " must contain a single entry for aggregation [" + name + "]");
    }
    if (!(parent instanceof HistogramAggregator.Factory)) {
        throw new IllegalStateException("cumulative sum aggregation [" + name
                + "] must have a histogram or date_histogram as parent");
    } else {
        HistogramAggregator.Factory histoParent = (HistogramAggregator.Factory) parent;
        if (histoParent.minDocCount() != 0) {
            throw new IllegalStateException("parent histogram of cumulative sum aggregation [" + name
                    + "] must have min_doc_count of 0");
        }
    }
}
 
Example #14
Source File: TDigestPercentileRanksAggregator.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
@Override
protected Aggregator doCreateInternal(ValuesSource.Numeric valuesSource, AggregationContext aggregationContext, Aggregator parent,
        boolean collectsFromSingleBucket, List<PipelineAggregator> pipelineAggregators, Map<String, Object> metaData)
        throws IOException {
    return new TDigestPercentileRanksAggregator(name, valuesSource, aggregationContext, parent, values, compression, keyed,
            config.formatter(), pipelineAggregators, metaData);
}
 
Example #15
Source File: GeoShapeAggregatorFactory.java    From elasticsearch-plugin-geoshape with MIT License 5 votes vote down vote up
@Override
protected Aggregator createUnmapped(
        SearchContext searchContext,
        Aggregator parent,
        List<PipelineAggregator> pipelineAggregators,
        Map<String,
                Object> metaData) throws IOException {
    final InternalAggregation aggregation = new InternalGeoShape(name, new ArrayList<>(), output_format,
            bucketCountThresholds.getRequiredSize(), bucketCountThresholds.getShardSize(),
            pipelineAggregators, metaData);
    return new NonCollectingAggregator(name, searchContext, parent, factories, pipelineAggregators, metaData) {
        @Override
        public InternalAggregation buildEmptyAggregation() { return aggregation; }
    };
}
 
Example #16
Source File: ExtendedStatsAggregator.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
@Override
protected Aggregator doCreateInternal(ValuesSource.Numeric valuesSource, AggregationContext aggregationContext, Aggregator parent,
        boolean collectsFromSingleBucket, List<PipelineAggregator> pipelineAggregators, Map<String, Object> metaData)
        throws IOException {
    return new ExtendedStatsAggregator(name, valuesSource, config.formatter(), aggregationContext, parent, sigma,
            pipelineAggregators, metaData);
}
 
Example #17
Source File: GlobalOrdinalsSignificantTermsAggregator.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
public WithHash(String name, AggregatorFactories factories, ValuesSource.Bytes.WithOrdinals.FieldData valuesSource,
        BucketCountThresholds bucketCountThresholds, IncludeExclude.OrdinalsFilter includeExclude,
        AggregationContext aggregationContext, Aggregator parent, SignificantTermsAggregatorFactory termsAggFactory,
        List<PipelineAggregator> pipelineAggregators, Map<String, Object> metaData) throws IOException {
    super(name, factories, valuesSource, bucketCountThresholds, includeExclude, aggregationContext, parent, termsAggFactory,
            pipelineAggregators, metaData);
    bucketOrds = new LongHash(1, aggregationContext.bigArrays());
}
 
Example #18
Source File: PredictionAggregatorFactory.java    From elasticsearch-linear-regression with Apache License 2.0 5 votes vote down vote up
@Override
protected Aggregator doCreateInternal(final List<NamedValuesSourceSpec<Numeric>> valuesSources,
    final Aggregator parent, final boolean collectsFromSingleBucket,
    final List<PipelineAggregator> pipelineAggregators, final Map<String, Object> metaData)
    throws IOException {
  return new PredictionAggregator(this.name, valuesSources, this.context, parent,
      this.multiValueMode, this.inputs,
      pipelineAggregators, metaData);
}
 
Example #19
Source File: ValueCountAggregator.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
public ValueCountAggregator(String name, ValuesSource valuesSource, ValueFormatter formatter,
        AggregationContext aggregationContext, Aggregator parent, List<PipelineAggregator> pipelineAggregators,
        Map<String, Object> metaData)
        throws IOException {
    super(name, aggregationContext, parent, pipelineAggregators, metaData);
    this.valuesSource = valuesSource;
    this.formatter = formatter;
    if (valuesSource != null) {
        counts = context.bigArrays().newLongArray(1, true);
    }
}
 
Example #20
Source File: StringTermsAggregator.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
public StringTermsAggregator(String name, AggregatorFactories factories, ValuesSource valuesSource,
        Terms.Order order, BucketCountThresholds bucketCountThresholds,
        IncludeExclude.StringFilter includeExclude, AggregationContext aggregationContext,
        Aggregator parent, SubAggCollectionMode collectionMode, boolean showTermDocCountError, List<PipelineAggregator> pipelineAggregators,
        Map<String, Object> metaData) throws IOException {

    super(name, factories, aggregationContext, parent, order, bucketCountThresholds, collectionMode, showTermDocCountError, pipelineAggregators,
            metaData);
    this.valuesSource = valuesSource;
    this.includeExclude = includeExclude;
    bucketOrds = new BytesRefHash(1, aggregationContext.bigArrays());
}
 
Example #21
Source File: TermsAggregatorFactory.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
@Override
Aggregator create(String name, AggregatorFactories factories, ValuesSource valuesSource, Terms.Order order,
        TermsAggregator.BucketCountThresholds bucketCountThresholds, IncludeExclude includeExclude,
        AggregationContext aggregationContext, Aggregator parent, SubAggCollectionMode subAggCollectMode,
        boolean showTermDocCountError, List<PipelineAggregator> pipelineAggregators, Map<String, Object> metaData)
        throws IOException {
    final IncludeExclude.StringFilter filter = includeExclude == null ? null : includeExclude.convertToStringFilter();
    return new StringTermsAggregator(name, factories, valuesSource, order, bucketCountThresholds, filter, aggregationContext,
            parent, subAggCollectMode, showTermDocCountError, pipelineAggregators, metaData);
}
 
Example #22
Source File: InternalBucketMetricValue.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
public InternalBucketMetricValue(String name, String[] keys, double value, ValueFormatter formatter,
        List<PipelineAggregator> pipelineAggregators, Map<String, Object> metaData) {
    super(name, pipelineAggregators, metaData);
    this.keys = keys;
    this.value = value;
    this.valueFormatter = formatter;
}
 
Example #23
Source File: PercolateShardResponse.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
@Override
public void readFrom(StreamInput in) throws IOException {
    super.readFrom(in);
    percolatorTypeId = in.readByte();
    requestedSize = in.readVInt();
    count = in.readVLong();
    matches = new BytesRef[in.readVInt()];
    for (int i = 0; i < matches.length; i++) {
        matches[i] = in.readBytesRef();
    }
    scores = new float[in.readVInt()];
    for (int i = 0; i < scores.length; i++) {
        scores[i] = in.readFloat();
    }
    int size = in.readVInt();
    for (int i = 0; i < size; i++) {
        int mSize = in.readVInt();
        Map<String, HighlightField> fields = new HashMap<>();
        for (int j = 0; j < mSize; j++) {
            fields.put(in.readString(), HighlightField.readHighlightField(in));
        }
        hls.add(fields);
    }
    aggregations = InternalAggregations.readOptionalAggregations(in);
    if (in.readBoolean()) {
        int pipelineAggregatorsSize = in.readVInt();
        List<SiblingPipelineAggregator> pipelineAggregators = new ArrayList<>(pipelineAggregatorsSize);
        for (int i = 0; i < pipelineAggregatorsSize; i++) {
            BytesReference type = in.readBytesReference();
            PipelineAggregator pipelineAggregator = PipelineAggregatorStreams.stream(type).readResult(in);
            pipelineAggregators.add((SiblingPipelineAggregator) pipelineAggregator);
        }
        this.pipelineAggregators = pipelineAggregators;
    }
}
 
Example #24
Source File: BucketSelectorBuilder.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
@Override
protected XContentBuilder internalXContent(XContentBuilder builder, Params builderParams) throws IOException {
    if (script != null) {
        builder.field(ScriptField.SCRIPT.getPreferredName(), script);
    }
    if (gapPolicy != null) {
        builder.field(BucketSelectorParser.GAP_POLICY.getPreferredName(), gapPolicy.getName());
    }
    if (bucketsPathsMap != null) {
        builder.field(PipelineAggregator.Parser.BUCKETS_PATH.getPreferredName(), bucketsPathsMap);
    }
    return builder;
}
 
Example #25
Source File: InternalPrediction.java    From elasticsearch-linear-regression with Apache License 2.0 5 votes vote down vote up
@Override
protected InternalPrediction buildInternalAggregation(final String name, final int featuresCount,
    final PredictionSampling linRegSampling, final PredictionResults results,
    final List<PipelineAggregator> pipelineAggregators, final Map<String, Object> metaData) {
  return new InternalPrediction(name, featuresCount, linRegSampling, results, this.inputs,
      pipelineAggregators,
      metaData);
}
 
Example #26
Source File: InternalAvg.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
public InternalAvg(String name, double sum, long count, ValueFormatter formatter, List<PipelineAggregator> pipelineAggregators,
        Map<String, Object> metaData) {
    super(name, pipelineAggregators, metaData);
    this.sum = sum;
    this.count = count;
    this.valueFormatter = formatter;
}
 
Example #27
Source File: GlobalOrdinalsStringTermsAggregator.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
public LowCardinality(String name, AggregatorFactories factories, ValuesSource.Bytes.WithOrdinals valuesSource,
        Terms.Order order,
        BucketCountThresholds bucketCountThresholds, AggregationContext aggregationContext, Aggregator parent,
        SubAggCollectionMode collectionMode, boolean showTermDocCountError, List<PipelineAggregator> pipelineAggregators,
        Map<String, Object> metaData) throws IOException {
    super(name, factories, valuesSource, order, bucketCountThresholds, null, aggregationContext, parent, collectionMode,
            showTermDocCountError, pipelineAggregators, metaData);
    assert factories == null || factories.count() == 0;
    this.segmentDocCounts = context.bigArrays().newIntArray(1, true);
}
 
Example #28
Source File: StatsAggregator.java    From elasticsearch-linear-regression with Apache License 2.0 5 votes vote down vote up
@Override
protected InternalAggregation doBuildAggregation(final String name, final int featuresCount,
    final StatsAggregationSampling statsAggregationSampling,
    final List<PipelineAggregator> pipelineAggregators,
    final Map<String, Object> stringObjectMap) {
  return new InternalStats(this.name, this.valuesSources.fieldNames().length - 1,
      statsAggregationSampling, null,
      pipelineAggregators(), metaData());
}
 
Example #29
Source File: SamplerAggregator.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
@Override
Aggregator create(String name, AggregatorFactories factories, int shardSize, int maxDocsPerValue, ValuesSource valuesSource,
        AggregationContext context, Aggregator parent, List<PipelineAggregator> pipelineAggregators,
        Map<String, Object> metaData) throws IOException {

    return new DiversifiedBytesHashSamplerAggregator(name, shardSize, factories, context, parent, pipelineAggregators,
            metaData,
            valuesSource,
            maxDocsPerValue);
}
 
Example #30
Source File: LongTermsAggregator.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
public LongTermsAggregator(String name, AggregatorFactories factories, ValuesSource.Numeric valuesSource, ValueFormat format,
        Terms.Order order, BucketCountThresholds bucketCountThresholds, AggregationContext aggregationContext, Aggregator parent,
        SubAggCollectionMode subAggCollectMode, boolean showTermDocCountError, IncludeExclude.LongFilter longFilter,
        List<PipelineAggregator> pipelineAggregators, Map<String, Object> metaData) throws IOException {
    super(name, factories, aggregationContext, parent, bucketCountThresholds, order, subAggCollectMode, pipelineAggregators, metaData);
    this.valuesSource = valuesSource;
    this.showTermDocCountError = showTermDocCountError;
    this.formatter = format.formatter();
    this.longFilter = longFilter;
    bucketOrds = new LongHash(1, aggregationContext.bigArrays());
}