Skip to content

Commit 6e7470b

Browse files
Support bucket sort pipeline aggregation (#7320) (#7324)
Co-authored-by: Steve Gordon <[email protected]>
1 parent 9d7bf46 commit 6e7470b

File tree

6 files changed

+602
-4
lines changed

6 files changed

+602
-4
lines changed

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

-2
Original file line numberDiff line numberDiff line change
@@ -399,8 +399,6 @@ public static void ReadAggregate(ref Utf8JsonReader reader, JsonSerializerOption
399399
throw new Exception("The aggregate in response is not yet supported.");
400400
case "bucket_selector":
401401
throw new Exception("The aggregate in response is not yet supported.");
402-
case "bucket_sort":
403-
throw new Exception("The aggregate in response is not yet supported.");
404402

405403
case "cumulative_cardinality":
406404
{

src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/Aggregation.g.cs

+20
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,11 @@ public override Aggregation Read(ref Utf8JsonReader reader, Type typeToConvert,
6464
return AggregationSerializationHelper.ReadContainer<Elastic.Clients.Elasticsearch.Aggregations.BoxplotAggregation?>("boxplot", ref reader, options);
6565
}
6666

67+
if (propertyName == "bucket_sort")
68+
{
69+
return AggregationSerializationHelper.ReadContainer<Elastic.Clients.Elasticsearch.Aggregations.BucketSortAggregation?>("bucket_sort", ref reader, options);
70+
}
71+
6772
if (propertyName == "cardinality")
6873
{
6974
return AggregationSerializationHelper.ReadContainer<Elastic.Clients.Elasticsearch.Aggregations.CardinalityAggregation?>("cardinality", ref reader, options);
@@ -316,6 +321,11 @@ public AggregationDescriptor<TDocument> Boxplot(string name, Action<BoxplotAggre
316321
return SetContainer(name, Aggregation.CreateWithAction("boxplot", configure));
317322
}
318323

324+
public AggregationDescriptor<TDocument> BucketSort(string name, Action<BucketSortAggregationDescriptor<TDocument>> configure)
325+
{
326+
return SetContainer(name, Aggregation.CreateWithAction("bucket_sort", configure));
327+
}
328+
319329
public AggregationDescriptor<TDocument> Cardinality(string name, Action<CardinalityAggregationDescriptor<TDocument>> configure)
320330
{
321331
return SetContainer(name, Aggregation.CreateWithAction("cardinality", configure));
@@ -564,6 +574,16 @@ public AggregationDescriptor Boxplot<TDocument>(string name, Action<BoxplotAggre
564574
return SetContainer(name, Aggregation.CreateWithAction("boxplot", configure));
565575
}
566576

577+
public AggregationDescriptor BucketSort(string name, Action<BucketSortAggregationDescriptor> configure)
578+
{
579+
return SetContainer(name, Aggregation.CreateWithAction("bucket_sort", configure));
580+
}
581+
582+
public AggregationDescriptor BucketSort<TDocument>(string name, Action<BucketSortAggregationDescriptor<TDocument>> configure)
583+
{
584+
return SetContainer(name, Aggregation.CreateWithAction("bucket_sort", configure));
585+
}
586+
567587
public AggregationDescriptor Cardinality(string name, Action<CardinalityAggregationDescriptor> configure)
568588
{
569589
return SetContainer(name, Aggregation.CreateWithAction("cardinality", configure));

0 commit comments

Comments
 (0)