@@ -54,6 +54,9 @@ public interface IHighlightField
5454
5555 [ JsonProperty ( "force_source" ) ]
5656 bool ? ForceSource { get ; set ; }
57+
58+ [ JsonProperty ( "matched_fields" ) ]
59+ IEnumerable < PropertyPathMarker > MatchedFields { get ; set ; }
5760 }
5861
5962 public class HighlightField : IHighlightField
@@ -73,6 +76,7 @@ public class HighlightField : IHighlightField
7376 public string BoundaryChars { get ; set ; }
7477 public string Type { get ; set ; }
7578 public bool ? ForceSource { get ; set ; }
79+ public IEnumerable < PropertyPathMarker > MatchedFields { get ; set ; }
7680 }
7781
7882 public class HighlightFieldDescriptor < T > : IHighlightField where T : class
@@ -108,6 +112,8 @@ public class HighlightFieldDescriptor<T> : IHighlightField where T : class
108112 string IHighlightField . Type { get ; set ; }
109113
110114 bool ? IHighlightField . ForceSource { get ; set ; }
115+
116+ IEnumerable < PropertyPathMarker > IHighlightField . MatchedFields { get ; set ; }
111117
112118 public HighlightFieldDescriptor < T > OnField ( string field )
113119 {
@@ -208,5 +214,15 @@ public HighlightFieldDescriptor<T> BoundaryMaxSize(int boundaryMaxSize)
208214 Self . BoundaryMaxSize = boundaryMaxSize ;
209215 return this ;
210216 }
217+ public HighlightFieldDescriptor < T > MatchedFields ( IEnumerable < string > fields )
218+ {
219+ Self . MatchedFields = fields . Select ( f => ( PropertyPathMarker ) f ) ;
220+ return this ;
221+ }
222+ public HighlightFieldDescriptor < T > MatchedFields ( params Expression < Func < T , object > > [ ] objectPaths )
223+ {
224+ Self . MatchedFields = objectPaths . Select ( f => ( PropertyPathMarker ) f ) ;
225+ return this ;
226+ }
211227 }
212228}
0 commit comments