Search in sources :

Example 1 with NonCollectingAggregator

use of org.opensearch.search.aggregations.NonCollectingAggregator in project OpenSearch by opensearch-project.

the class TermsAggregatorFactory method createUnmapped.

@Override
protected Aggregator createUnmapped(SearchContext searchContext, Aggregator parent, Map<String, Object> metadata) throws IOException {
    final InternalAggregation aggregation = new UnmappedTerms(name, order, bucketCountThresholds.getRequiredSize(), bucketCountThresholds.getMinDocCount(), metadata);
    Aggregator agg = new NonCollectingAggregator(name, searchContext, parent, factories, metadata) {

        @Override
        public InternalAggregation buildEmptyAggregation() {
            return aggregation;
        }
    };
    // even in the case of an unmapped aggregator, validate the order
    order.validate(agg);
    return agg;
}
Also used : InternalAggregation(org.opensearch.search.aggregations.InternalAggregation) NonCollectingAggregator(org.opensearch.search.aggregations.NonCollectingAggregator) NonCollectingAggregator(org.opensearch.search.aggregations.NonCollectingAggregator) Aggregator(org.opensearch.search.aggregations.Aggregator)

Aggregations

Aggregator (org.opensearch.search.aggregations.Aggregator)1 InternalAggregation (org.opensearch.search.aggregations.InternalAggregation)1 NonCollectingAggregator (org.opensearch.search.aggregations.NonCollectingAggregator)1