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;
}
Aggregations