Skip to content

Commit b446314

Browse files
committed
Deprecate factor on DateHistogramAggregation
Closes #2124
1 parent af468f9 commit b446314

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/Nest/Aggregations/Bucket/DateHistogram/DateHistogramAggregation.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ public interface IDateHistogramAggregation : IBucketAggregation
3030
[JsonProperty("time_zone")]
3131
string TimeZone { get; set; }
3232

33+
[Obsolete("Deprecated. Will be removed in the next major version")]
3334
[JsonProperty("factor")]
3435
int? Factor { get; set; }
3536

@@ -58,7 +59,7 @@ public string Format
5859
{
5960
get
6061
{
61-
return !string.IsNullOrEmpty(_format) &&
62+
return !string.IsNullOrEmpty(_format) &&
6263
!_format.Contains("date_optional_time") &&
6364
ExtendedBounds != null
6465
? _format + "||date_optional_time"
@@ -69,7 +70,10 @@ public string Format
6970

7071
public int? MinimumDocumentCount { get; set; }
7172
public string TimeZone { get; set; }
73+
74+
[Obsolete("Deprecated. Will be removed in the next major version")]
7275
public int? Factor { get; set; }
76+
7377
public string Offset { get; set; }
7478
public HistogramOrder Order { get; set; }
7579
public ExtendedBounds<DateTime> ExtendedBounds { get; set; }
@@ -144,6 +148,7 @@ public DateHistogramAggregationDescriptor<T> MinimumDocumentCount(int minimumDoc
144148

145149
public DateHistogramAggregationDescriptor<T> TimeZone(string timeZone) => Assign(a => a.TimeZone = timeZone);
146150

151+
[Obsolete("Deprecated. Will be removed in the next major version")]
147152
public DateHistogramAggregationDescriptor<T> Interval(int factor) => Assign(a => a.Factor = factor);
148153

149154
public DateHistogramAggregationDescriptor<T> Offset(string offset) => Assign(a => a.Offset = offset);
@@ -161,4 +166,4 @@ public DateHistogramAggregationDescriptor<T> ExtendedBounds(DateTime min, DateTi
161166

162167
public DateHistogramAggregationDescriptor<T> Missing(DateTime missing) => Assign(a => a.Missing = missing);
163168
}
164-
}
169+
}

0 commit comments

Comments
 (0)