44
55namespace Nest
66{
7+ /// <summary>
8+ /// Data type mapping to map a property as a geopoint
9+ /// </summary>
710 [ JsonObject ( MemberSerialization . OptIn ) ]
811 public interface IGeoPointProperty : IDocValuesProperty
912 {
13+ /// <summary>
14+ /// If true, malformed geo-points are ignored. If false (default), malformed
15+ /// geo-points throw an exception and reject the whole document.
16+ /// </summary>
1017 [ JsonProperty ( "ignore_malformed" ) ]
1118 bool ? IgnoreMalformed { get ; set ; }
19+
20+
21+ /// <summary>
22+ /// If true (default) three dimension points will be accepted (stored in source) but only
23+ /// latitude and longitude values will be indexed; the third dimension is ignored. If false, geo-points
24+ /// containing any more than latitude and longitude (two dimensions) values
25+ /// throw an exception and reject the whole document.
26+ /// </summary>
27+ [ JsonProperty ( "ignore_z_value" ) ]
28+ bool ? IgnoreZValue { get ; set ; }
29+
30+ /// <summary>
31+ /// Accepts a geo_point value which is substituted for any explicit null values.
32+ /// Defaults to null, which means the field is treated as missing.
33+ /// </summary>
34+ [ JsonProperty ( "null_value" ) ]
35+ GeoLocation NullValue { get ; set ; }
1236 }
1337
1438 [ DebuggerDisplay ( "{DebugDisplay}" ) ]
1539 public class GeoPointProperty : DocValuesPropertyBase , IGeoPointProperty
1640 {
1741 public GeoPointProperty ( ) : base ( FieldType . GeoPoint ) { }
1842
43+ /// <inheritdoc />
1944 public bool ? IgnoreMalformed { get ; set ; }
45+
46+ /// <inheritdoc />
47+ public bool ? IgnoreZValue { get ; set ; }
48+
49+ /// <inheritdoc />
50+ public GeoLocation NullValue { get ; set ; }
2051 }
2152
2253 [ DebuggerDisplay ( "{DebugDisplay}" ) ]
@@ -25,9 +56,18 @@ public class GeoPointPropertyDescriptor<T>
2556 where T : class
2657 {
2758 bool ? IGeoPointProperty . IgnoreMalformed { get ; set ; }
59+ bool ? IGeoPointProperty . IgnoreZValue { get ; set ; }
60+ GeoLocation IGeoPointProperty . NullValue { get ; set ; }
2861
2962 public GeoPointPropertyDescriptor ( ) : base ( FieldType . GeoPoint ) { }
3063
64+ /// <inheritdoc cref="IGeoPointProperty.IgnoreMalformed" />
3165 public GeoPointPropertyDescriptor < T > IgnoreMalformed ( bool ? ignoreMalformed = true ) => Assign ( a => a . IgnoreMalformed = ignoreMalformed ) ;
66+
67+ /// <inheritdoc cref="IGeoPointProperty.IgnoreZValue" />
68+ public GeoPointPropertyDescriptor < T > IgnoreZValue ( bool ? ignoreZValue = true ) => Assign ( a => a . IgnoreZValue = ignoreZValue ) ;
69+
70+ /// <inheritdoc cref="IGeoPointProperty.NullValue" />
71+ public GeoPointPropertyDescriptor < T > NullValue ( GeoLocation defaultValue ) => Assign ( a => a . NullValue = defaultValue ) ;
3272 }
3373}
0 commit comments