Skip to content

Commit

Permalink
iter
Browse files Browse the repository at this point in the history
  • Loading branch information
javanna committed Nov 2, 2023
1 parent 685d49d commit ee3e0aa
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 34 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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());
Expand Down

0 comments on commit ee3e0aa

Please sign in to comment.