Skip to content

Commit 5f9530f

Browse files
authored
Add support for additional bucket aggregations. (#7485)
* Generate additional bucket aggregations * Add tests for bucket aggregations * Rename verify files * Skip IP prefix test in < 8.1 * Add release notes for 8.0.8 (#7465)
1 parent 59e6782 commit 5f9530f

File tree

73 files changed

+7600
-388
lines changed

Some content is hidden

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

73 files changed

+7600
-388
lines changed

exclusion.dic

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
deserialize
22
json
3-
async
43
inferrer
54
elasticsearch
65
asciidocs
76
yyyy
87
enum
9-
trippable
8+
trippable
9+
geotile

src/Elastic.Clients.Elasticsearch/Types/Aggregations/AggregateDictionary.cs

-11
This file was deleted.

src/Elastic.Clients.Elasticsearch/Types/Aggregations/AggregateDictionaryConverter.cs

+42-73
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,6 @@ public static void ReadAggregate(ref Utf8JsonReader reader, JsonSerializerOption
7474
break;
7575
}
7676

77-
case "categorize_text":
78-
throw new Exception("The aggregate in response is not yet supported");
79-
8077
case "children":
8178
{
8279
var agg = JsonSerializer.Deserialize<ChildrenAggregate>(ref reader, options);
@@ -105,9 +102,6 @@ public static void ReadAggregate(ref Utf8JsonReader reader, JsonSerializerOption
105102
break;
106103
}
107104

108-
case "diversified_sampler":
109-
throw new Exception("The aggregate in response is not yet supported");
110-
111105
case "filter":
112106
{
113107
var agg = JsonSerializer.Deserialize<FilterAggregate>(ref reader, options);
@@ -122,26 +116,26 @@ public static void ReadAggregate(ref Utf8JsonReader reader, JsonSerializerOption
122116
break;
123117
}
124118

125-
//case "geo_distance":
126-
// {
127-
// var agg = JsonSerializer.Deserialize<GeoDistanceAggregate>(ref reader, options);
128-
// dictionary.Add(nameParts[1], agg);
129-
// break;
130-
// }
119+
case "geo_distance":
120+
{
121+
var agg = JsonSerializer.Deserialize<GeoDistanceAggregate>(ref reader, options);
122+
dictionary.Add(nameParts[1], agg);
123+
break;
124+
}
131125

132-
//case "geohash_grid":
133-
// {
134-
// var agg = JsonSerializer.Deserialize<GeoHashGridAggregate>(ref reader, options);
135-
// dictionary.Add(nameParts[1], agg);
136-
// break;
137-
// }
126+
case "geohash_grid":
127+
{
128+
var agg = JsonSerializer.Deserialize<GeohashGridAggregate>(ref reader, options);
129+
dictionary.Add(nameParts[1], agg);
130+
break;
131+
}
138132

139-
//case "geotile_grid":
140-
// {
141-
// var agg = JsonSerializer.Deserialize<GeoTileGridAggregate>(ref reader, options);
142-
// dictionary.Add(nameParts[1], agg);
143-
// break;
144-
// }
133+
case "geotile_grid":
134+
{
135+
var agg = JsonSerializer.Deserialize<GeotileGridAggregate>(ref reader, options);
136+
dictionary.Add(nameParts[1], agg);
137+
break;
138+
}
145139

146140
case "global":
147141
{
@@ -164,6 +158,13 @@ public static void ReadAggregate(ref Utf8JsonReader reader, JsonSerializerOption
164158
break;
165159
}
166160

161+
case "ip_prefix":
162+
{
163+
var agg = JsonSerializer.Deserialize<IpPrefixAggregate>(ref reader, options);
164+
dictionary.Add(nameParts[1], agg);
165+
break;
166+
}
167+
167168
case "missing":
168169
{
169170
var agg = JsonSerializer.Deserialize<MissingAggregate>(ref reader, options);
@@ -199,9 +200,6 @@ public static void ReadAggregate(ref Utf8JsonReader reader, JsonSerializerOption
199200
break;
200201
}
201202

202-
case "rare_terms":
203-
throw new Exception("The aggregate in response is not yet supported");
204-
205203
case "reverse_nested":
206204
{
207205
var agg = JsonSerializer.Deserialize<ReverseNestedAggregate>(ref reader, options);
@@ -216,11 +214,12 @@ public static void ReadAggregate(ref Utf8JsonReader reader, JsonSerializerOption
216214
break;
217215
}
218216

219-
case "significant_terms":
220-
throw new Exception("The aggregate in response is not yet supported");
221-
222-
case "significant_text":
223-
throw new Exception("The aggregate in response is not yet supported");
217+
case "sigsterms":
218+
{
219+
var agg = JsonSerializer.Deserialize<SignificantStringTermsAggregate>(ref reader, options);
220+
dictionary.Add(nameParts[1], agg);
221+
break;
222+
}
224223

225224
case "variable_width_histogram":
226225
{
@@ -231,14 +230,14 @@ public static void ReadAggregate(ref Utf8JsonReader reader, JsonSerializerOption
231230

232231
case "avg":
233232
{
234-
var agg = JsonSerializer.Deserialize<AvgAggregate>(ref reader, options);
233+
var agg = JsonSerializer.Deserialize<AverageAggregate>(ref reader, options);
235234
dictionary.Add(nameParts[1], agg);
236235
break;
237236
}
238237

239238
case "boxplot":
240239
{
241-
var agg = JsonSerializer.Deserialize<BoxPlotAggregate>(ref reader, options);
240+
var agg = JsonSerializer.Deserialize<BoxplotAggregate>(ref reader, options);
242241
dictionary.Add(nameParts[1], agg);
243242
break;
244243
}
@@ -278,6 +277,13 @@ public static void ReadAggregate(ref Utf8JsonReader reader, JsonSerializerOption
278277
// break;
279278
// }
280279

280+
case "srareterms":
281+
{
282+
var agg = JsonSerializer.Deserialize<StringRareTermsAggregate>(ref reader, options);
283+
dictionary.Add(nameParts[1], agg);
284+
break;
285+
}
286+
281287
case "matrix_stats":
282288
{
283289
var agg = JsonSerializer.Deserialize<MatrixStatsAggregate>(ref reader, options);
@@ -306,19 +312,13 @@ public static void ReadAggregate(ref Utf8JsonReader reader, JsonSerializerOption
306312
break;
307313
}
308314

309-
case "percentile_ranks":
310-
throw new Exception("The aggregate in response is not yet supported.");
311-
312315
case "tdigest_percentile_ranks":
313316
{
314317
var agg = JsonSerializer.Deserialize<TDigestPercentileRanksAggregate>(ref reader, options);
315318
dictionary.Add(nameParts[1], agg);
316319
break;
317320
}
318321

319-
case "percentiles":
320-
throw new Exception("The aggregate in response is not yet supported.");
321-
322322
case "rate":
323323
{
324324
var agg = JsonSerializer.Deserialize<RateAggregate>(ref reader, options);
@@ -384,22 +384,11 @@ public static void ReadAggregate(ref Utf8JsonReader reader, JsonSerializerOption
384384

385385
case "weighted_avg":
386386
{
387-
var agg = JsonSerializer.Deserialize<WeightedAvgAggregate>(ref reader, options);
387+
var agg = JsonSerializer.Deserialize<WeightedAverageAggregate>(ref reader, options);
388388
dictionary.Add(nameParts[1], agg);
389389
break;
390390
}
391391

392-
case "avg_bucket":
393-
throw new Exception("The aggregate in response is not yet supported.");
394-
case "bucket_script":
395-
throw new Exception("The aggregate in response is not yet supported.");
396-
case "bucket_count_ks_test":
397-
throw new Exception("The aggregate in response is not yet supported.");
398-
case "bucket_correlation":
399-
throw new Exception("The aggregate in response is not yet supported.");
400-
case "bucket_selector":
401-
throw new Exception("The aggregate in response is not yet supported.");
402-
403392
case "cumulative_cardinality":
404393
{
405394
var agg = JsonSerializer.Deserialize<CumulativeCardinalityAggregate>(ref reader, options);
@@ -436,42 +425,22 @@ public static void ReadAggregate(ref Utf8JsonReader reader, JsonSerializerOption
436425
dictionary.Add(nameParts[1], agg);
437426
break;
438427
}
439-
440-
case "max_bucket":
441-
throw new Exception("The aggregate in response is not yet supported.");
442-
case "min_bucket":
443-
throw new Exception("The aggregate in response is not yet supported.");
444-
case "moving_avg":
445-
throw new Exception("The aggregate in response is not yet supported.");
446-
case "moving_fn":
447-
throw new Exception("The aggregate in response is not yet supported.");
448-
case "moving_percentiles":
449-
throw new Exception("The aggregate in response is not yet supported.");
450-
case "normalize":
451-
throw new Exception("The aggregate in response is not yet supported.");
452-
453428
case "percentiles_bucket":
454429
{
455430
var agg = JsonSerializer.Deserialize<PercentilesBucketAggregate>(ref reader, options);
456431
dictionary.Add(nameParts[1], agg);
457432
break;
458433
}
459434

460-
case "serial_diff":
461-
throw new Exception("The aggregate in response is not yet supported.");
462-
463435
case "stats_bucket":
464436
{
465437
var agg = JsonSerializer.Deserialize<StatsBucketAggregate>(ref reader, options);
466438
dictionary.Add(nameParts[1], agg);
467439
break;
468440
}
469441

470-
case "sum_bucket":
471-
throw new Exception("The aggregate in response is not yet supported.");
472-
473442
default:
474-
throw new Exception("The aggregate in response is not yet supported.");
443+
throw new Exception($"The aggregate '{aggregateName}' in this response is not currently supported.");
475444
}
476445
}
477446

src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.AsyncSearch.g.cs

+8-8
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ internal AsyncSearchNamespacedClient(ElasticsearchClient client) : base(client)
3838

3939
/// <summary>
4040
/// <para>Retrieves the status of a previously submitted async search request given its ID.</para>
41-
/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/8.7/async-search.html">Learn more about this API in the Elasticsearch documentation.</see></para>
41+
/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/8.6/async-search.html">Learn more about this API in the Elasticsearch documentation.</see></para>
4242
/// </summary>
4343
public virtual AsyncSearchStatusResponse Status(AsyncSearchStatusRequest request)
4444
{
@@ -48,7 +48,7 @@ public virtual AsyncSearchStatusResponse Status(AsyncSearchStatusRequest request
4848

4949
/// <summary>
5050
/// <para>Retrieves the status of a previously submitted async search request given its ID.</para>
51-
/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/8.7/async-search.html">Learn more about this API in the Elasticsearch documentation.</see></para>
51+
/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/8.6/async-search.html">Learn more about this API in the Elasticsearch documentation.</see></para>
5252
/// </summary>
5353
public virtual Task<AsyncSearchStatusResponse> StatusAsync(AsyncSearchStatusRequest request, CancellationToken cancellationToken = default)
5454
{
@@ -104,7 +104,7 @@ public virtual Task<AsyncSearchStatusResponse> StatusAsync<TDocument>(Elastic.Cl
104104

105105
/// <summary>
106106
/// <para>Deletes an async search by ID. If the search is still running, the search request will be cancelled. Otherwise, the saved search results are deleted.</para>
107-
/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/8.7/async-search.html">Learn more about this API in the Elasticsearch documentation.</see></para>
107+
/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/8.6/async-search.html">Learn more about this API in the Elasticsearch documentation.</see></para>
108108
/// </summary>
109109
public virtual DeleteAsyncSearchResponse Delete(DeleteAsyncSearchRequest request)
110110
{
@@ -114,7 +114,7 @@ public virtual DeleteAsyncSearchResponse Delete(DeleteAsyncSearchRequest request
114114

115115
/// <summary>
116116
/// <para>Deletes an async search by ID. If the search is still running, the search request will be cancelled. Otherwise, the saved search results are deleted.</para>
117-
/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/8.7/async-search.html">Learn more about this API in the Elasticsearch documentation.</see></para>
117+
/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/8.6/async-search.html">Learn more about this API in the Elasticsearch documentation.</see></para>
118118
/// </summary>
119119
public virtual Task<DeleteAsyncSearchResponse> DeleteAsync(DeleteAsyncSearchRequest request, CancellationToken cancellationToken = default)
120120
{
@@ -170,7 +170,7 @@ public virtual Task<DeleteAsyncSearchResponse> DeleteAsync<TDocument>(Elastic.Cl
170170

171171
/// <summary>
172172
/// <para>Retrieves the results of a previously submitted async search request given its ID.</para>
173-
/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/8.7/async-search.html">Learn more about this API in the Elasticsearch documentation.</see></para>
173+
/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/8.6/async-search.html">Learn more about this API in the Elasticsearch documentation.</see></para>
174174
/// </summary>
175175
public virtual GetAsyncSearchResponse<TDocument> Get<TDocument>(GetAsyncSearchRequest request)
176176
{
@@ -180,7 +180,7 @@ public virtual GetAsyncSearchResponse<TDocument> Get<TDocument>(GetAsyncSearchRe
180180

181181
/// <summary>
182182
/// <para>Retrieves the results of a previously submitted async search request given its ID.</para>
183-
/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/8.7/async-search.html">Learn more about this API in the Elasticsearch documentation.</see></para>
183+
/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/8.6/async-search.html">Learn more about this API in the Elasticsearch documentation.</see></para>
184184
/// </summary>
185185
public virtual Task<GetAsyncSearchResponse<TDocument>> GetAsync<TDocument>(GetAsyncSearchRequest request, CancellationToken cancellationToken = default)
186186
{
@@ -220,7 +220,7 @@ public virtual Task<GetAsyncSearchResponse<TDocument>> GetAsync<TDocument>(Elast
220220

221221
/// <summary>
222222
/// <para>Executes a search request asynchronously.</para>
223-
/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/8.7/async-search.html">Learn more about this API in the Elasticsearch documentation.</see></para>
223+
/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/8.6/async-search.html">Learn more about this API in the Elasticsearch documentation.</see></para>
224224
/// </summary>
225225
public virtual SubmitAsyncSearchResponse<TDocument> Submit<TDocument>(SubmitAsyncSearchRequest request)
226226
{
@@ -230,7 +230,7 @@ public virtual SubmitAsyncSearchResponse<TDocument> Submit<TDocument>(SubmitAsyn
230230

231231
/// <summary>
232232
/// <para>Executes a search request asynchronously.</para>
233-
/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/8.7/async-search.html">Learn more about this API in the Elasticsearch documentation.</see></para>
233+
/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/8.6/async-search.html">Learn more about this API in the Elasticsearch documentation.</see></para>
234234
/// </summary>
235235
public virtual Task<SubmitAsyncSearchResponse<TDocument>> SubmitAsync<TDocument>(SubmitAsyncSearchRequest request, CancellationToken cancellationToken = default)
236236
{

src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Cluster.g.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ internal ClusterNamespacedClient(ElasticsearchClient client) : base(client)
3838

3939
/// <summary>
4040
/// <para>Returns basic information about the health of the cluster.</para>
41-
/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/8.7/cluster-health.html">Learn more about this API in the Elasticsearch documentation.</see></para>
41+
/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/8.6/cluster-health.html">Learn more about this API in the Elasticsearch documentation.</see></para>
4242
/// </summary>
4343
public virtual HealthResponse Health(HealthRequest request)
4444
{
@@ -48,7 +48,7 @@ public virtual HealthResponse Health(HealthRequest request)
4848

4949
/// <summary>
5050
/// <para>Returns basic information about the health of the cluster.</para>
51-
/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/8.7/cluster-health.html">Learn more about this API in the Elasticsearch documentation.</see></para>
51+
/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/8.6/cluster-health.html">Learn more about this API in the Elasticsearch documentation.</see></para>
5252
/// </summary>
5353
public virtual Task<HealthResponse> HealthAsync(HealthRequest request, CancellationToken cancellationToken = default)
5454
{

0 commit comments

Comments
 (0)