diff --git a/server/src/test/java/org/elasticsearch/search/aggregations/AggregatorFactoriesTests.java b/server/src/test/java/org/elasticsearch/search/aggregations/AggregatorFactoriesTests.java index d67e99e4521f1..45527a005375c 100644 --- a/server/src/test/java/org/elasticsearch/search/aggregations/AggregatorFactoriesTests.java +++ b/server/src/test/java/org/elasticsearch/search/aggregations/AggregatorFactoriesTests.java @@ -25,6 +25,9 @@ import org.elasticsearch.script.Script; import org.elasticsearch.search.SearchModule; import org.elasticsearch.search.aggregations.bucket.composite.CompositeAggregationBuilder; +import org.elasticsearch.search.aggregations.bucket.composite.DateHistogramValuesSourceBuilder; +import org.elasticsearch.search.aggregations.bucket.composite.GeoTileGridValuesSourceBuilder; +import org.elasticsearch.search.aggregations.bucket.composite.HistogramValuesSourceBuilder; import org.elasticsearch.search.aggregations.bucket.composite.TermsValuesSourceBuilder; import org.elasticsearch.search.aggregations.bucket.filter.FilterAggregationBuilder; import org.elasticsearch.search.aggregations.bucket.nested.NestedAggregationBuilder; @@ -344,10 +347,31 @@ public void testSupportsParallelCollection() { { AggregatorFactories.Builder builder = new AggregatorFactories.Builder(); builder.addAggregator( - new CompositeAggregationBuilder("composite", Collections.singletonList(new TermsValuesSourceBuilder("name"))) + new CompositeAggregationBuilder("composite", Collections.singletonList(new GeoTileGridValuesSourceBuilder("name"))) + ); + assertTrue(builder.supportsParallelCollection()); + } + { + AggregatorFactories.Builder builder = new AggregatorFactories.Builder(); + builder.addAggregator( + new CompositeAggregationBuilder("composite", Collections.singletonList(new HistogramValuesSourceBuilder("name"))) + ); + assertTrue(builder.supportsParallelCollection()); + } + { + AggregatorFactories.Builder builder = new AggregatorFactories.Builder(); + builder.addAggregator( + new CompositeAggregationBuilder("composite", Collections.singletonList(new DateHistogramValuesSourceBuilder("name"))) ); assertTrue(builder.supportsParallelCollection()); } + { + AggregatorFactories.Builder builder = new AggregatorFactories.Builder(); + builder.addAggregator( + new CompositeAggregationBuilder("composite", Collections.singletonList(new TermsValuesSourceBuilder("name"))) + ); + assertFalse(builder.supportsParallelCollection()); + } { AggregatorFactories.Builder builder = new AggregatorFactories.Builder(); builder.addAggregator(new FilterAggregationBuilder("terms", new MatchAllQueryBuilder()) { diff --git a/server/src/test/java/org/elasticsearch/search/builder/SearchSourceBuilderTests.java b/server/src/test/java/org/elasticsearch/search/builder/SearchSourceBuilderTests.java index d36aced867171..d5dd265fb1ea0 100644 --- a/server/src/test/java/org/elasticsearch/search/builder/SearchSourceBuilderTests.java +++ b/server/src/test/java/org/elasticsearch/search/builder/SearchSourceBuilderTests.java @@ -34,11 +34,6 @@ import org.elasticsearch.script.ScriptType; import org.elasticsearch.search.AbstractSearchTestCase; import org.elasticsearch.search.SearchExtBuilder; -import org.elasticsearch.search.aggregations.bucket.composite.CompositeAggregationBuilder; -import org.elasticsearch.search.aggregations.bucket.composite.DateHistogramValuesSourceBuilder; -import org.elasticsearch.search.aggregations.bucket.composite.GeoTileGridValuesSourceBuilder; -import org.elasticsearch.search.aggregations.bucket.composite.HistogramValuesSourceBuilder; -import org.elasticsearch.search.aggregations.bucket.composite.TermsValuesSourceBuilder; import org.elasticsearch.search.aggregations.bucket.terms.TermsAggregationBuilder; import org.elasticsearch.search.aggregations.metrics.MaxAggregationBuilder; import org.elasticsearch.search.collapse.CollapseBuilder; @@ -926,34 +921,6 @@ public void testSupportsParallelCollection() { searchSourceBuilder.aggregation(new TermsAggregationBuilder("terms")); assertFalse(searchSourceBuilder.supportsParallelCollection()); } - { - SearchSourceBuilder searchSourceBuilder = newSearchSourceBuilder.get(); - searchSourceBuilder.aggregation( - new CompositeAggregationBuilder("name", Collections.singletonList(new DateHistogramValuesSourceBuilder("name"))) - ); - assertTrue(searchSourceBuilder.supportsParallelCollection()); - } - { - SearchSourceBuilder searchSourceBuilder = newSearchSourceBuilder.get(); - searchSourceBuilder.aggregation( - new CompositeAggregationBuilder("name", Collections.singletonList(new HistogramValuesSourceBuilder("name"))) - ); - assertTrue(searchSourceBuilder.supportsParallelCollection()); - } - { - SearchSourceBuilder searchSourceBuilder = newSearchSourceBuilder.get(); - searchSourceBuilder.aggregation( - new CompositeAggregationBuilder("name", Collections.singletonList(new GeoTileGridValuesSourceBuilder("name"))) - ); - assertTrue(searchSourceBuilder.supportsParallelCollection()); - } - { - SearchSourceBuilder searchSourceBuilder = newSearchSourceBuilder.get(); - searchSourceBuilder.aggregation( - new CompositeAggregationBuilder("name", Collections.singletonList(new TermsValuesSourceBuilder("name"))) - ); - assertFalse(searchSourceBuilder.supportsParallelCollection()); - } { SearchSourceBuilder searchSourceBuilder = newSearchSourceBuilder.get(); searchSourceBuilder.collapse(CollapseBuilderTests.randomCollapseBuilder());