diff --git a/core/src/main/java/org/elasticsearch/search/aggregations/AggregationBuilder.java b/core/src/main/java/org/elasticsearch/search/aggregations/AggregationBuilder.java index 14875895b77..16f8ef2444f 100644 --- a/core/src/main/java/org/elasticsearch/search/aggregations/AggregationBuilder.java +++ b/core/src/main/java/org/elasticsearch/search/aggregations/AggregationBuilder.java @@ -27,6 +27,7 @@ import org.elasticsearch.index.query.QueryParseContext; import org.elasticsearch.search.internal.SearchContext; import java.io.IOException; +import java.util.List; import java.util.Map; /** @@ -69,6 +70,16 @@ public abstract class AggregationBuilder /** Add a sub aggregation to this builder. */ public abstract AggregationBuilder subAggregation(PipelineAggregationBuilder aggregation); + /** Return the configured set of subaggregations **/ + public List getSubAggregations() { + return factoriesBuilder.getAggregatorFactories(); + } + + /** Return the configured set of pipeline aggregations **/ + public List getPipelineAggregations() { + return factoriesBuilder.getPipelineAggregatorFactories(); + } + /** * Internal: Registers sub-factories with this factory. The sub-factory will be * responsible for the creation of sub-aggregators under the aggregator diff --git a/core/src/main/java/org/elasticsearch/search/aggregations/bucket/filter/FilterAggregationBuilder.java b/core/src/main/java/org/elasticsearch/search/aggregations/bucket/filter/FilterAggregationBuilder.java index 9fb8b368e9d..19d3f32f39d 100644 --- a/core/src/main/java/org/elasticsearch/search/aggregations/bucket/filter/FilterAggregationBuilder.java +++ b/core/src/main/java/org/elasticsearch/search/aggregations/bucket/filter/FilterAggregationBuilder.java @@ -102,4 +102,8 @@ public class FilterAggregationBuilder extends AbstractAggregationBuilder