File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed
Nest.Tests.Unit/Search/Sort Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ public void TestSort()
17
17
. OnField ( e => e . Country )
18
18
. MissingLast ( )
19
19
. Descending ( )
20
+ . IgnoreUnmappedFields ( true )
20
21
) ;
21
22
var json = TestElasticClient . Serialize ( s ) ;
22
23
var expected = @"
@@ -26,7 +27,8 @@ public void TestSort()
26
27
sort: {
27
28
country: {
28
29
missing: ""_last"",
29
- order: ""desc""
30
+ order: ""desc"",
31
+ ignore_unmapped: true
30
32
}
31
33
}
32
34
}" ;
Original file line number Diff line number Diff line change @@ -23,6 +23,9 @@ public class SortDescriptor<T> where T : class
23
23
24
24
[ JsonProperty ( "nested_path" ) ]
25
25
internal string _NestedPath { get ; set ; }
26
+
27
+ [ JsonProperty ( "ignore_unmapped" ) ]
28
+ internal bool ? _IgnoreUnmappedFields { get ; set ; }
26
29
27
30
public virtual SortDescriptor < T > OnField ( string field )
28
31
{
@@ -60,6 +63,11 @@ public virtual SortDescriptor<T> MissingValue(string value)
60
63
this . _Missing = value ;
61
64
return this ;
62
65
}
66
+ public virtual SortDescriptor < T > IgnoreUnmappedFields ( bool ignore = true )
67
+ {
68
+ this . _IgnoreUnmappedFields = ignore ;
69
+ return this ;
70
+ }
63
71
public virtual SortDescriptor < T > Ascending ( )
64
72
{
65
73
this . _Order = "asc" ;
You can’t perform that action at this time.
0 commit comments