Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(date-range-agg): Add Missing method #4024

Merged
merged 1 commit into from
Aug 16, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ public interface IDateRangeAggregation : IBucketAggregation
[JsonProperty("format")]
string Format { get; set; }

[JsonProperty("missing")]
object Missing { get; set; }

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

Expand All @@ -31,6 +34,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 @@ -46,6 +50,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 @@ -56,6 +62,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