@@ -7,16 +7,45 @@ namespace Nest
7
7
[ JsonObject ( MemberSerialization . OptIn ) ]
8
8
public interface IGeoPointProperty : IDocValuesProperty
9
9
{
10
+ /// <summary>
11
+ /// If true, malformed geo-points are ignored. If false (default), malformed
12
+ /// geo-points throw an exception and reject the whole document.
13
+ /// </summary>
10
14
[ JsonProperty ( "ignore_malformed" ) ]
11
15
bool ? IgnoreMalformed { get ; set ; }
16
+
17
+
18
+ /// <summary>
19
+ /// If true (default) three dimension points will be accepted (stored in source) but only
20
+ /// latitude and longitude values will be indexed; the third dimension is ignored. If false, geo-points
21
+ /// containing any more than latitude and longitude (two dimensions) values
22
+ /// throw an exception and reject the whole document.
23
+ /// </summary>
24
+ [ JsonProperty ( "ignore_z_value" ) ]
25
+ bool ? IgnoreZValue { get ; set ; }
26
+
27
+ /// <summary>
28
+ /// Accepts an geopoint value which is substituted for any explicit null values.
29
+ /// Defaults to null, which means the field is treated as missing.
30
+ /// </summary>
31
+ [ JsonProperty ( "null_value" ) ]
32
+ GeoLocation NullValue { get ; set ; }
33
+
12
34
}
13
35
14
36
[ DebuggerDisplay ( "{DebugDisplay}" ) ]
15
37
public class GeoPointProperty : DocValuesPropertyBase , IGeoPointProperty
16
38
{
17
39
public GeoPointProperty ( ) : base ( FieldType . GeoPoint ) { }
18
40
41
+ /// <inheritdoc />
19
42
public bool ? IgnoreMalformed { get ; set ; }
43
+
44
+ /// <inheritdoc />
45
+ public bool ? IgnoreZValue { get ; set ; }
46
+
47
+ /// <inheritdoc />
48
+ public GeoLocation NullValue { get ; set ; }
20
49
}
21
50
22
51
[ DebuggerDisplay ( "{DebugDisplay}" ) ]
@@ -25,9 +54,18 @@ public class GeoPointPropertyDescriptor<T>
25
54
where T : class
26
55
{
27
56
bool ? IGeoPointProperty . IgnoreMalformed { get ; set ; }
57
+ bool ? IGeoPointProperty . IgnoreZValue { get ; set ; }
58
+ GeoLocation IGeoPointProperty . NullValue { get ; set ; }
28
59
29
60
public GeoPointPropertyDescriptor ( ) : base ( FieldType . GeoPoint ) { }
30
61
62
+ /// <inheritdoc cref="IGeoPointProperty.IgnoreMalformed" />
31
63
public GeoPointPropertyDescriptor < T > IgnoreMalformed ( bool ? ignoreMalformed = true ) => Assign ( a => a . IgnoreMalformed = ignoreMalformed ) ;
64
+
65
+ /// <inheritdoc cref="IGeoPointProperty.IgnoreZValue" />
66
+ public GeoPointPropertyDescriptor < T > IgnoreZValue ( bool ? ignoreZValue = true ) => Assign ( a => a . IgnoreZValue = ignoreZValue ) ;
67
+
68
+ /// <inheritdoc cref="IGeoPointProperty.NullValue" />
69
+ public GeoPointPropertyDescriptor < T > NullValue ( GeoLocation defaultValue ) => Assign ( a => a . NullValue = defaultValue ) ;
32
70
}
33
71
}
0 commit comments