/// <summary> /// By default the returned buckets are sorted by their key ascending, though the order behaviour can be controled using the order setting. /// </summary> public TAggregation Order(string key, OrderDirection direction = OrderDirection.asc) { RegisterJsonPart("'order': {{ {0}: {1} }}", key.Quotate(), direction.AsString().Quotate()); return((TAggregation)this); }
/// <summary> /// Allows to control the ordering of the terms aggregations /// </summary> public TermsAggregation <T> Order(string field, OrderDirection order) { RegisterJsonPart("'order': {{ {0} : {1} }}", field, order.AsString().Quotate()); return(this); }