1- using Newtonsoft . Json ;
1+ using System ;
2+ using Newtonsoft . Json ;
23
34namespace Nest
45{
@@ -11,10 +12,10 @@ public interface IGeoDistanceRangeQuery : IFieldNameQuery
1112
1213 [ JsonProperty ( "gte" ) ]
1314 Distance GreaterThanOrEqualTo { get ; set ; }
14-
15+
1516 [ JsonProperty ( "lte" ) ]
1617 Distance LessThanOrEqualTo { get ; set ; }
17-
18+
1819 [ JsonProperty ( "gt" ) ]
1920 Distance GreaterThan { get ; set ; }
2021
@@ -23,19 +24,21 @@ public interface IGeoDistanceRangeQuery : IFieldNameQuery
2324
2425 [ JsonProperty ( "distance_type" ) ]
2526 GeoDistanceType ? DistanceType { get ; set ; }
26-
27+
2728 [ JsonProperty ( "optimize_bbox" ) ]
2829 GeoOptimizeBBox ? OptimizeBoundingBox { get ; set ; }
29-
30+
31+ [ Obsolete ( "Deprecated. Use ValidationMethod" ) ]
3032 [ JsonProperty ( "coerce" ) ]
3133 bool ? Coerce { get ; set ; }
3234
35+ [ Obsolete ( "Deprecated. Use ValidationMethod" ) ]
3336 [ JsonProperty ( "ignore_malformed" ) ]
3437 bool ? IgnoreMalformed { get ; set ; }
35-
38+
3639 [ JsonProperty ( "validation_method" ) ]
3740 GeoValidationMethod ? ValidationMethod { get ; set ; }
38-
41+
3942 }
4043
4144 public class GeoDistanceRangeQuery : FieldNameQueryBase , IGeoDistanceRangeQuery
@@ -48,18 +51,22 @@ public class GeoDistanceRangeQuery : FieldNameQueryBase, IGeoDistanceRangeQuery
4851 public Distance LessThanOrEqualTo { get ; set ; }
4952 public GeoDistanceType ? DistanceType { get ; set ; }
5053 public GeoOptimizeBBox ? OptimizeBoundingBox { get ; set ; }
54+
55+ [ Obsolete ( "Deprecated. Use ValidationMethod" ) ]
5156 public bool ? Coerce { get ; set ; }
57+
58+ [ Obsolete ( "Deprecated. Use ValidationMethod" ) ]
5259 public bool ? IgnoreMalformed { get ; set ; }
5360 public GeoValidationMethod ? ValidationMethod { get ; set ; }
5461
5562 internal override void InternalWrapInContainer ( IQueryContainer c ) => c . GeoDistanceRange = this ;
5663
57- internal static bool IsConditionless ( IGeoDistanceRangeQuery q ) =>
58- q . Field == null || q . Location == null
64+ internal static bool IsConditionless ( IGeoDistanceRangeQuery q ) =>
65+ q . Field == null || q . Location == null
5966 || ( q . LessThan == null && q . LessThanOrEqualTo == null && q . GreaterThanOrEqualTo == null && q . GreaterThan == null ) ;
6067 }
6168
62- public class GeoDistanceRangeQueryDescriptor < T > : FieldNameQueryDescriptorBase < GeoDistanceRangeQueryDescriptor < T > , IGeoDistanceRangeQuery , T >
69+ public class GeoDistanceRangeQueryDescriptor < T > : FieldNameQueryDescriptorBase < GeoDistanceRangeQueryDescriptor < T > , IGeoDistanceRangeQuery , T >
6370 , IGeoDistanceRangeQuery where T : class
6471 {
6572 protected override bool Conditionless => GeoDistanceRangeQuery . IsConditionless ( this ) ;
@@ -86,20 +93,21 @@ public GeoDistanceRangeQueryDescriptor<T> GreaterThanOrEqualTo(double distance,
8693 Assign ( a => a . GreaterThanOrEqualTo = new Distance ( distance , unit ) ) ;
8794
8895 public GeoDistanceRangeQueryDescriptor < T > LessThanOrEqualTo ( Distance to ) => Assign ( a => a . LessThanOrEqualTo = to ) ;
89- public GeoDistanceRangeQueryDescriptor < T > LessThanOrEqualTo ( double distance , DistanceUnit unit ) =>
96+ public GeoDistanceRangeQueryDescriptor < T > LessThanOrEqualTo ( double distance , DistanceUnit unit ) =>
9097 Assign ( a => a . LessThanOrEqualTo = new Distance ( distance , unit ) ) ;
9198
9299 public GeoDistanceRangeQueryDescriptor < T > LessThan ( Distance to ) => Assign ( a => a . LessThan = to ) ;
93- public GeoDistanceRangeQueryDescriptor < T > LessThan ( double distance , DistanceUnit unit ) =>
100+ public GeoDistanceRangeQueryDescriptor < T > LessThan ( double distance , DistanceUnit unit ) =>
94101 Assign ( a => a . LessThan = new Distance ( distance , unit ) ) ;
95102
96103 public GeoDistanceRangeQueryDescriptor < T > Optimize ( GeoOptimizeBBox optimize ) => Assign ( a => a . OptimizeBoundingBox = optimize ) ;
97104
98105 public GeoDistanceRangeQueryDescriptor < T > DistanceType ( GeoDistanceType geoDistance ) => Assign ( a => a . DistanceType = geoDistance ) ;
99106
100-
107+ [ Obsolete ( "Deprecated. Use ValidationMethod(GeoValidationMethod? validation)" ) ]
101108 public GeoDistanceRangeQueryDescriptor < T > Coerce ( bool ? coerce = true ) => Assign ( a => a . Coerce = coerce ) ;
102109
110+ [ Obsolete ( "Deprecated. Use ValidationMethod(GeoValidationMethod? validation)" ) ]
103111 public GeoDistanceRangeQueryDescriptor < T > IgnoreMalformed ( bool ? ignore = true ) => Assign ( a => a . IgnoreMalformed = ignore ) ;
104112
105113 public GeoDistanceRangeQueryDescriptor < T > ValidationMethod ( GeoValidationMethod ? validation ) => Assign ( a => a . ValidationMethod = validation ) ;
0 commit comments