Aggregations: Throw error if cardinality aggregator has a sub aggregation

The cardinality aggregation is a metric aggregation and therefore cannot accept sub-aggregations. It was previously possible to create a rest request with a cardinality aggregation that had sub-aggregations. Now such a request will throw an error in the response.

Close #12988
This commit is contained in:
Colin Goodheart-Smithe 2015-08-19 14:31:30 +01:00
parent ca28acc373
commit 88d482437a
1 changed files with 1 additions and 1 deletions

View File

@ -31,7 +31,7 @@ import java.io.IOException;
import java.util.List;
import java.util.Map;
final class CardinalityAggregatorFactory extends ValuesSourceAggregatorFactory<ValuesSource> {
final class CardinalityAggregatorFactory extends ValuesSourceAggregatorFactory.LeafOnly<ValuesSource> {
private final long precisionThreshold;