You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-[1. Improved usability of `CompositeAggregation`](#1-composite-aggregation)
27
+
28
+
### Breaking changes
29
+
30
+
#### 1. Improved usability of `CompositeAggregation`[#1-composite-aggregation]
31
+
32
+
**Impact**: Low.
33
+
34
+
The type of the `Sources` property has been changed from `ICollection<IDictionary<string, CompositeAggregationSource>>` to `ICollection<KeyValuePair<string, CompositeAggregationSource>>`. This corresponds to the Elasticsearch standard for modeling ordered dictionaries in the REST API.
35
+
36
+
`CompositeAggregationSource` is now also a container (similar to `Aggregation`, `Query`, etc.). This change improves usability due to specialized code generation. For example, implicit conversion operators from all existing variants (`CompositeTermsAggregation`, `CompositeHistogramAggregation`, etc.) to `CompositeAggregationSource` are now generated.
37
+
38
+
As a consequence, the object initializer syntax changes as follows:
1. This is the `params` overload that initializes the `Sources` collection with multiple entries.
142
+
2. Add dictionary item 1 that contains a single `Terms` aggregation entry.
143
+
3. Add dictionary item 2 that contains a single `Histogram` aggregation entry.
144
+
145
+
The old syntax was tricky because the 9.1.8 example also compiled successfully, but the `.Add` referred to the first dictionary both times. This ultimately resulted in a list with only one dictionary, which had multiple entries, and thus an invalid request.
0 commit comments