Skip to content
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
12 changes: 12 additions & 0 deletions src/Nest/DSL/Filter/RangeFilterDescriptor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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; }
}
Expand All @@ -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; }
}
Expand All @@ -63,6 +67,8 @@ public class RangeFilterDescriptor<T> : 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; }
Expand Down Expand Up @@ -196,6 +202,12 @@ public RangeFilterDescriptor<T> LowerOrEquals(DateTime? to, string format = "yyy
return this;
}

public RangeFilterDescriptor<T> Format(string format)
{
this.Self.Format = format;
return this;
}

public RangeFilterDescriptor<T> TimeZone(string timeZone)
{
this.Self.TimeZone = timeZone;
Expand Down
13 changes: 13 additions & 0 deletions src/Nest/DSL/Query/RangeQueryDescriptor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)]
Expand All @@ -82,6 +86,8 @@ public class RangeQueryDescriptor<T> : IRangeQuery where T : class

string IRangeQuery.TimeZone { get; set; }

string IRangeQuery.Format { get; set; }

PropertyPathMarker IRangeQuery.Field { get; set; }

bool IQuery.IsConditionless
Expand Down Expand Up @@ -210,5 +216,12 @@ public RangeQueryDescriptor<T> TimeZone(string timeZone)
return this;
}

public RangeQueryDescriptor<T> Format(string format)
{
this.Self.Format = format;
return this;
}


}
}