diff --git a/src/Nest/DSL/Filter/RangeFilterDescriptor.cs b/src/Nest/DSL/Filter/RangeFilterDescriptor.cs index 18d66a926f3..f5a9e732472 100644 --- a/src/Nest/DSL/Filter/RangeFilterDescriptor.cs +++ b/src/Nest/DSL/Filter/RangeFilterDescriptor.cs @@ -32,6 +32,9 @@ public interface IRangeFilter : IFieldNameFilter [JsonProperty("time_zone")] string TimeZone { get; set; } + [JsonProperty("format")] + string Format { get; set; } + [JsonProperty("execution")] RangeExecution? Execution { get; set; } } @@ -47,6 +50,7 @@ protected internal override void WrapInContainer(IFilterContainer container) public string GreaterThan { get; set; } public string LowerThan { get; set; } public string TimeZone { get; set; } + public string Format { get; set; } public RangeExecution? Execution { get; set; } public PropertyPathMarker Field { get; set; } } @@ -63,6 +67,8 @@ public class RangeFilterDescriptor : FilterBase, IRangeFilter where T : class string IRangeFilter.TimeZone { get; set; } + string IRangeFilter.Format { get; set; } + RangeExecution? IRangeFilter.Execution { get; set; } PropertyPathMarker IFieldNameFilter.Field { get; set; } @@ -196,6 +202,12 @@ public RangeFilterDescriptor LowerOrEquals(DateTime? to, string format = "yyy return this; } + public RangeFilterDescriptor Format(string format) + { + this.Self.Format = format; + return this; + } + public RangeFilterDescriptor TimeZone(string timeZone) { this.Self.TimeZone = timeZone; diff --git a/src/Nest/DSL/Query/RangeQueryDescriptor.cs b/src/Nest/DSL/Query/RangeQueryDescriptor.cs index 0f75b4e2652..5371121a859 100644 --- a/src/Nest/DSL/Query/RangeQueryDescriptor.cs +++ b/src/Nest/DSL/Query/RangeQueryDescriptor.cs @@ -33,6 +33,9 @@ public interface IRangeQuery : IFieldNameQuery [JsonProperty("time_zone")] string TimeZone { get; set; } + [JsonProperty("format")] + string Format { get; set; } + PropertyPathMarker Field { get; set; } } public class RangeQuery : PlainQuery, IRangeQuery @@ -61,6 +64,7 @@ void IFieldNameQuery.SetFieldName(string fieldName) public bool? Cache { get; set; } public string Name { get; set; } public string TimeZone { get; set; } + public string Format { get; set; } public PropertyPathMarker Field { get; set; } } [JsonObject(MemberSerialization = MemberSerialization.OptIn)] @@ -82,6 +86,8 @@ public class RangeQueryDescriptor : IRangeQuery where T : class string IRangeQuery.TimeZone { get; set; } + string IRangeQuery.Format { get; set; } + PropertyPathMarker IRangeQuery.Field { get; set; } bool IQuery.IsConditionless @@ -210,5 +216,12 @@ public RangeQueryDescriptor TimeZone(string timeZone) return this; } + public RangeQueryDescriptor Format(string format) + { + this.Self.Format = format; + return this; + } + + } }