Skip to content

Commit

Permalink
Add missing parameter to date range aggregation method (Port of #4024)
Browse files Browse the repository at this point in the history
(cherry picked from commit d7c2e83)
  • Loading branch information
codebrain authored and russcam committed Sep 3, 2019
1 parent 7d5d0af commit bca626a
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ public interface IDateRangeAggregation : IBucketAggregation
[DataMember(Name ="format")]
string Format { get; set; }

[DataMember(Name="missing")]
object Missing { get; set; }

[DataMember(Name ="ranges")]
IEnumerable<IDateRangeExpression> Ranges { get; set; }

Expand All @@ -32,6 +35,7 @@ public DateRangeAggregation(string name) : base(name) { }

public Field Field { get; set; }
public string Format { get; set; }
public object Missing { get; set; }
public IEnumerable<IDateRangeExpression> Ranges { get; set; }
public string TimeZone { get; set; }

Expand All @@ -47,6 +51,8 @@ public class DateRangeAggregationDescriptor<T>

string IDateRangeAggregation.Format { get; set; }

object IDateRangeAggregation.Missing { get; set; }

IEnumerable<IDateRangeExpression> IDateRangeAggregation.Ranges { get; set; }

string IDateRangeAggregation.TimeZone { get; set; }
Expand All @@ -57,6 +63,8 @@ public class DateRangeAggregationDescriptor<T>

public DateRangeAggregationDescriptor<T> Format(string format) => Assign(format, (a, v) => a.Format = v);

public DateRangeAggregationDescriptor<T> Missing(object missing) => Assign(missing, (a, v) => a.Missing = v);

public DateRangeAggregationDescriptor<T> Ranges(params IDateRangeExpression[] ranges) =>
Assign(ranges.ToListOrNullIfEmpty(), (a, v) => a.Ranges = v);

Expand Down

0 comments on commit bca626a

Please sign in to comment.