Skip to content

Commit 928b681

Browse files
Stuart Camrusscam
authored andcommitted
Add support for date histogram format. (#3594)
(cherry picked from commit 0b8fb97)
1 parent 7117d9a commit 928b681

File tree

1 file changed

+22
-6
lines changed

1 file changed

+22
-6
lines changed

src/Nest/XPack/RollUp/RollupConfiguration/DateHistogramRollupGrouping.cs

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,29 +12,37 @@ namespace Nest
1212
public interface IDateHistogramRollupGrouping
1313
{
1414
/// <summary>
15-
/// How long to wait before rolling up new documents. By default, the indexer attempts to roll up all data that is available.
15+
/// How long to wait before rolling up new documents. By default, the indexer attempts to roll up all data that is
16+
/// available.
1617
/// </summary>
17-
[DataMember(Name ="delay")]
18+
[DataMember(Name = "delay")]
1819
Time Delay { get; set; }
1920

2021
/// <summary>
2122
/// The date field that is to be rolled up
2223
/// </summary>
23-
[DataMember(Name ="field")]
24+
[DataMember(Name = "field")]
2425
Field Field { get; set; }
2526

27+
/// <summary>
28+
/// Date format. Supports expressive date format pattern.
29+
/// </summary>
30+
[DataMember(Name = "format")]
31+
string Format { get; set; }
32+
2633
/// <summary>
2734
/// The interval of time buckets to be generated when rolling up. E.g. "60m" will produce 60 minute (hourly) rollups.
2835
/// The interval defines the minimum interval that can be aggregated only.
2936
/// </summary>
30-
[DataMember(Name ="interval")]
37+
[DataMember(Name = "interval")]
3138
Time Interval { get; set; }
3239

3340
/// <summary>
34-
/// Defines what time_zone the rollup documents are stored as. Unlike raw data, which can shift timezones on the fly, rolled
41+
/// Defines what time_zone the rollup documents are stored as. Unlike raw data, which can shift timezones on the fly,
42+
/// rolled
3543
/// documents have to be stored with a specific timezone. By default, rollup documents are stored in UT
3644
/// </summary>
37-
[DataMember(Name ="time_zone")]
45+
[DataMember(Name = "time_zone")]
3846
string TimeZone { get; set; }
3947
}
4048

@@ -47,6 +55,9 @@ public class DateHistogramRollupGrouping : IDateHistogramRollupGrouping
4755
/// <inheritdoc />
4856
public Field Field { get; set; }
4957

58+
/// <inheritdoc />
59+
public string Format { get; set; }
60+
5061
/// <inheritdoc />
5162
public Time Interval { get; set; }
5263

@@ -61,6 +72,8 @@ public class DateHistogramRollupGroupingDescriptor<T>
6172
{
6273
Time IDateHistogramRollupGrouping.Delay { get; set; }
6374
Field IDateHistogramRollupGrouping.Field { get; set; }
75+
76+
string IDateHistogramRollupGrouping.Format { get; set; }
6477
Time IDateHistogramRollupGrouping.Interval { get; set; }
6578
string IDateHistogramRollupGrouping.TimeZone { get; set; }
6679

@@ -78,5 +91,8 @@ public class DateHistogramRollupGroupingDescriptor<T>
7891

7992
/// <inheritdoc cref="IDateHistogramRollupGrouping.TimeZone" />
8093
public DateHistogramRollupGroupingDescriptor<T> TimeZone(string timeZone) => Assign(a => a.TimeZone = timeZone);
94+
95+
/// <inheritdoc cref="IDateHistogramRollupGrouping.Format" />
96+
public DateHistogramRollupGroupingDescriptor<T> Format(string format) => Assign(a => a.Format = format);
8197
}
8298
}

0 commit comments

Comments
 (0)