Skip to content

ExtendedBounds property of the DateHistogramAggregation to use DateMath #2829

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

Merged
merged 1 commit into from
Sep 5, 2017
Merged
Show file tree
Hide file tree
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 @@ -37,7 +37,7 @@ public interface IDateHistogramAggregation : IBucketAggregation
HistogramOrder Order { get; set; }

[JsonProperty("extended_bounds")]
ExtendedBounds<DateTime> ExtendedBounds { get; set; }
ExtendedBounds<DateMath> ExtendedBounds { get; set; }

[JsonProperty("missing")]
DateTime? Missing { get; set; }
Expand Down Expand Up @@ -68,7 +68,7 @@ public string Format
public string TimeZone { get; set; }
public string Offset { get; set; }
public HistogramOrder Order { get; set; }
public ExtendedBounds<DateTime> ExtendedBounds { get; set; }
public ExtendedBounds<DateMath> ExtendedBounds { get; set; }
public DateTime? Missing { get; set; }

internal DateHistogramAggregation() { }
Expand Down Expand Up @@ -113,7 +113,7 @@ string IDateHistogramAggregation.Format

HistogramOrder IDateHistogramAggregation.Order { get; set; }

ExtendedBounds<DateTime> IDateHistogramAggregation.ExtendedBounds { get; set; }
ExtendedBounds<DateMath> IDateHistogramAggregation.ExtendedBounds { get; set; }

DateTime? IDateHistogramAggregation.Missing { get; set; }

Expand Down Expand Up @@ -148,8 +148,8 @@ public DateHistogramAggregationDescriptor<T> OrderAscending(string key) =>
public DateHistogramAggregationDescriptor<T> OrderDescending(string key) =>
Assign(a => a.Order = new HistogramOrder { Key = key, Order = SortOrder.Descending });

public DateHistogramAggregationDescriptor<T> ExtendedBounds(DateTime min, DateTime max) =>
Assign(a=>a.ExtendedBounds = new ExtendedBounds<DateTime> { Minimum = min, Maximum = max });
public DateHistogramAggregationDescriptor<T> ExtendedBounds(DateMath min, DateMath max) =>
Assign(a=>a.ExtendedBounds = new ExtendedBounds<DateMath> { Minimum = min, Maximum = max });

public DateHistogramAggregationDescriptor<T> Missing(DateTime missing) => Assign(a => a.Missing = missing);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public DateHistogramAggregationUsageTests(ReadOnlyCluster i, EndpointUsage usage
Interval = DateInterval.Month,
MinimumDocumentCount = 2,
Format = "yyyy-MM-dd'T'HH:mm:ss",
ExtendedBounds = new ExtendedBounds<DateTime>
ExtendedBounds = new ExtendedBounds<DateMath>
{
Minimum = FixedDate.AddYears(-1),
Maximum = FixedDate.AddYears(1),
Expand Down