NEST by Elastic and contributors

<PackageReference Include="NEST" Version="6.8.5" />

.NET API 5,339,136 bytes

 IBucketSortAggregation

A parent pipeline aggregation which sorts the buckets of its parent multi-bucket aggregation. Zero or more sort fields may be specified together with the corresponding sort order. Each bucket may be sorted based on its _key, _count or its sub-aggregations. In addition, parameters from and size may be set in order to truncate the result buckets.
int? From { get; set; }

Buckets in positions prior to the set value will be truncated

GapPolicy? GapPolicy { get; set; }

The policy to apply when gaps are found in the data

int? Size { get; set; }

The number of buckets to return. Defaults to all buckets of the parent aggregation

IList<ISort> Sort { get; set; }

The list of fields to sort on