Skip to content

Commit 64b174e

Browse files
committed
Merge remote-tracking branch 'origin/main' into non-issue/esql-full-text-functions-disjunctions
2 parents f55978a + 723387a commit 64b174e

File tree

52 files changed

+1722
-555
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+1722
-555
lines changed

benchmarks/src/main/java/org/elasticsearch/benchmark/search/aggregations/TermsReduceBenchmark.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ public void setup() {
111111
dict[i] = new BytesRef(Long.toString(rand.nextLong()));
112112
}
113113
for (int i = 0; i < numShards; i++) {
114-
aggsList.add(InternalAggregations.from(Collections.singletonList(newTerms(rand, dict, true))));
114+
aggsList.add(InternalAggregations.from(newTerms(rand, dict, true)));
115115
}
116116
}
117117

@@ -124,7 +124,7 @@ private StringTerms newTerms(Random rand, BytesRef[] dict, boolean withNested) {
124124
for (BytesRef term : randomTerms) {
125125
InternalAggregations subAggs;
126126
if (withNested) {
127-
subAggs = InternalAggregations.from(Collections.singletonList(newTerms(rand, dict, false)));
127+
subAggs = InternalAggregations.from(newTerms(rand, dict, false));
128128
} else {
129129
subAggs = InternalAggregations.EMPTY;
130130
}

benchmarks/src/main/java/org/elasticsearch/benchmark/search/aggregations/bucket/terms/StringTermsSerializationBenchmark.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,13 @@ public class StringTermsSerializationBenchmark {
5050

5151
@Setup
5252
public void initResults() {
53-
results = DelayableWriteable.referencing(InternalAggregations.from(List.of(newTerms(true))));
53+
results = DelayableWriteable.referencing(InternalAggregations.from(newTerms(true)));
5454
}
5555

5656
private StringTerms newTerms(boolean withNested) {
5757
List<StringTerms.Bucket> resultBuckets = new ArrayList<>(buckets);
5858
for (int i = 0; i < buckets; i++) {
59-
InternalAggregations inner = withNested ? InternalAggregations.from(List.of(newTerms(false))) : InternalAggregations.EMPTY;
59+
InternalAggregations inner = withNested ? InternalAggregations.from(newTerms(false)) : InternalAggregations.EMPTY;
6060
resultBuckets.add(new StringTerms.Bucket(new BytesRef("test" + i), i, inner, false, 0, DocValueFormat.RAW));
6161
}
6262
return new StringTerms(

docs/changelog/120483.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 120483
2+
summary: Fix NPE on disabled API auth key cache
3+
area: Authentication
4+
type: bug
5+
issues: []

docs/changelog/120505.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 120505
2+
summary: "introduce new categories for deprecated resources in deprecation API"
3+
area: Indices APIs
4+
type: enhancement
5+
issues: []

docs/changelog/120883.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 120883
2+
summary: Add `?master_timeout` to `POST /_ilm/migrate_to_data_tiers`
3+
area: Indices APIs
4+
type: bug
5+
issues: []

docs/reference/search/async-search.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ nor search requests that only include the <<search-suggesters,suggest section>>.
143143
WARNING: By default, {es} doesn't allow to store an async search response
144144
larger than 10Mb, and an attempt to do this results in an error. The maximum
145145
allowed size for a stored async search response can be set by changing the
146-
`search.max_async_search_response_size` cluster level setting.
146+
`search.max_async_search_response_size` (<<dynamic-cluster-setting,Dynamic>>) cluster level setting.
147147

148148
[[get-async-search]]
149149
==== Get async search

modules/aggregations/src/main/java/org/elasticsearch/aggregations/bucket/histogram/InternalAutoDateHistogram.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,7 @@ private BucketReduceResult addEmptyBuckets(BucketReduceResult current, Aggregati
414414

415415
Bucket lastBucket = null;
416416
ListIterator<Bucket> iter = list.listIterator();
417-
InternalAggregations reducedEmptySubAggs = InternalAggregations.reduce(List.of(bucketInfo.emptySubAggregations), reduceContext);
417+
InternalAggregations reducedEmptySubAggs = InternalAggregations.reduce(bucketInfo.emptySubAggregations, reduceContext);
418418

419419
// Add the empty buckets within the data,
420420
// e.g. if the data series is [1,2,3,7] there're 3 empty buckets that will be created for 4,5,6

modules/aggregations/src/main/java/org/elasticsearch/aggregations/bucket/timeseries/InternalTimeSeries.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ public InternalAggregation get() {
222222
InternalBucket reducedBucket;
223223
if (bucketsWithSameKey.size() == 1) {
224224
reducedBucket = bucketsWithSameKey.get(0);
225-
reducedBucket.aggregations = InternalAggregations.reduce(List.of(reducedBucket.aggregations), reduceContext);
225+
reducedBucket.aggregations = InternalAggregations.reduce(reducedBucket.aggregations, reduceContext);
226226
} else {
227227
reducedBucket = reduceBucket(bucketsWithSameKey, reduceContext);
228228
}

modules/aggregations/src/main/java/org/elasticsearch/aggregations/pipeline/DerivativePipelineAggregator.java

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@
2222
import java.util.ArrayList;
2323
import java.util.List;
2424
import java.util.Map;
25-
import java.util.stream.Collectors;
26-
import java.util.stream.StreamSupport;
2725

2826
import static org.elasticsearch.search.aggregations.pipeline.BucketHelpers.resolveBucketValue;
2927

@@ -69,11 +67,16 @@ public InternalAggregation reduce(InternalAggregation aggregation, AggregationRe
6967
if (xAxisUnits != null) {
7068
xDiff = (thisBucketKey.doubleValue() - lastBucketKey.doubleValue()) / xAxisUnits;
7169
}
72-
final List<InternalAggregation> aggs = StreamSupport.stream(bucket.getAggregations().spliterator(), false)
73-
.collect(Collectors.toCollection(ArrayList::new));
74-
aggs.add(new Derivative(name(), gradient, xDiff, formatter, metadata()));
75-
Bucket newBucket = factory.createBucket(factory.getKey(bucket), bucket.getDocCount(), InternalAggregations.from(aggs));
76-
newBuckets.add(newBucket);
70+
newBuckets.add(
71+
factory.createBucket(
72+
factory.getKey(bucket),
73+
bucket.getDocCount(),
74+
InternalAggregations.append(
75+
bucket.getAggregations(),
76+
new Derivative(name(), gradient, xDiff, formatter, metadata())
77+
)
78+
)
79+
);
7780
} else {
7881
newBuckets.add(bucket);
7982
}

modules/aggregations/src/main/java/org/elasticsearch/aggregations/pipeline/MovFnPipelineAggregator.java

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@
2525
import java.util.HashMap;
2626
import java.util.List;
2727
import java.util.Map;
28-
import java.util.stream.Collectors;
29-
import java.util.stream.StreamSupport;
3028

3129
import static org.elasticsearch.search.aggregations.pipeline.BucketHelpers.resolveBucketValue;
3230

@@ -117,12 +115,11 @@ public InternalAggregation reduce(InternalAggregation aggregation, AggregationRe
117115
vars,
118116
values.subList(fromIndex, toIndex).stream().mapToDouble(Double::doubleValue).toArray()
119117
);
120-
121-
List<InternalAggregation> aggs = StreamSupport.stream(bucket.getAggregations().spliterator(), false)
122-
.map(InternalAggregation.class::cast)
123-
.collect(Collectors.toCollection(ArrayList::new));
124-
aggs.add(new InternalSimpleValue(name(), result, formatter, metadata()));
125-
newBucket = factory.createBucket(factory.getKey(bucket), bucket.getDocCount(), InternalAggregations.from(aggs));
118+
newBucket = factory.createBucket(
119+
factory.getKey(bucket),
120+
bucket.getDocCount(),
121+
InternalAggregations.append(bucket.getAggregations(), new InternalSimpleValue(name(), result, formatter, metadata()))
122+
);
126123
index++;
127124
}
128125
newBuckets.add(newBucket);

0 commit comments

Comments
 (0)