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()
1717 . OnField ( e => e . Country )
1818 . MissingLast ( )
1919 . Descending ( )
20+ . IgnoreUnmappedFields ( true )
2021 ) ;
2122 var json = TestElasticClient . Serialize ( s ) ;
2223 var expected = @"
@@ -26,7 +27,8 @@ public void TestSort()
2627 sort: {
2728 country: {
2829 missing: ""_last"",
29- order: ""desc""
30+ order: ""desc"",
31+ ignore_unmapped: true
3032 }
3133 }
3234 }" ;
Original file line number Diff line number Diff line change @@ -23,6 +23,9 @@ public class SortDescriptor<T> where T : class
2323
2424 [ JsonProperty ( "nested_path" ) ]
2525 internal string _NestedPath { get ; set ; }
26+
27+ [ JsonProperty ( "ignore_unmapped" ) ]
28+ internal bool ? _IgnoreUnmappedFields { get ; set ; }
2629
2730 public virtual SortDescriptor < T > OnField ( string field )
2831 {
@@ -60,6 +63,11 @@ public virtual SortDescriptor<T> MissingValue(string value)
6063 this . _Missing = value ;
6164 return this ;
6265 }
66+ public virtual SortDescriptor < T > IgnoreUnmappedFields ( bool ignore = true )
67+ {
68+ this . _IgnoreUnmappedFields = ignore ;
69+ return this ;
70+ }
6371 public virtual SortDescriptor < T > Ascending ( )
6472 {
6573 this . _Order = "asc" ;
You can’t perform that action at this time.
0 commit comments