Skip to content

Commit b1802f1

Browse files
author
Hendrik Muhs
committed
adapt to upstream changes
1 parent 8eb7976 commit b1802f1

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

x-pack/plugin/ml-feature-index-builder/src/main/java/org/elasticsearch/xpack/ml/featureindexbuilder/job/AggregationConfig.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
import org.elasticsearch.search.aggregations.AggregationBuilder;
1616
import org.elasticsearch.search.aggregations.AggregatorFactories;
1717
import java.io.IOException;
18-
import java.util.List;
18+
import java.util.Collection;
1919
import java.util.Objects;
2020

2121
/*
@@ -46,7 +46,7 @@ public void writeTo(StreamOutput out) throws IOException {
4646
aggregatorFactoryBuilder.writeTo(out);
4747
}
4848

49-
public List<AggregationBuilder> getAggregatorFactories() {
49+
public Collection<AggregationBuilder> getAggregatorFactories() {
5050
return aggregatorFactoryBuilder.getAggregatorFactories();
5151
}
5252

x-pack/plugin/ml-feature-index-builder/src/main/java/org/elasticsearch/xpack/ml/featureindexbuilder/job/FeatureIndexBuilderIndexer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ protected IterationResult<Map<String, Object>> doProcess(SearchResponse searchRe
6969
private List<IndexRequest> processBuckets(CompositeAggregation agg) {
7070
// for now only 1 source supported
7171
String destinationFieldName = job.getConfig().getSourceConfig().getSources().get(0).name();
72-
String aggName = job.getConfig().getAggregationConfig().getAggregatorFactories().get(0).getName();
72+
String aggName = job.getConfig().getAggregationConfig().getAggregatorFactories().iterator().next().getName();
7373

7474
return agg.getBuckets().stream().map(b -> {
7575
NumericMetricsAggregation.SingleValue aggResult = b.getAggregations().get(aggName);

0 commit comments

Comments
 (0)