@@ -25,6 +25,7 @@ public SuggestUsageTests(ReadOnlyCluster cluster, EndpointUsage usage) : base(cl
2525 new
2626 {
2727 query = ProjectFilterExpectedJson ,
28+ docvalue_fields = new [ ] { "state" } ,
2829 suggest = new Dictionary < string , object >
2930 {
3031 {
@@ -110,6 +111,9 @@ public SuggestUsageTests(ReadOnlyCluster cluster, EndpointUsage usage) : base(cl
110111
111112 protected override Func < SearchDescriptor < Project > , ISearchRequest > Fluent => s => s
112113 . Query ( q => ProjectFilter )
114+ . DocValueFields ( d => d
115+ . Field ( f => f . State )
116+ )
113117 . Suggest ( ss => ss
114118 . Term ( "my-term-suggest" , t => t
115119 . MaxEdits ( 1 )
@@ -168,6 +172,7 @@ public SuggestUsageTests(ReadOnlyCluster cluster, EndpointUsage usage) : base(cl
168172 new SearchRequest < Project >
169173 {
170174 Query = ProjectFilter ,
175+ DocValueFields = Fields < Project > ( f => f . State ) ,
171176 Suggest = new SuggestContainer
172177 {
173178 {
@@ -269,6 +274,8 @@ protected override void ExpectResponse(ISearchResponse<Project> response)
269274 option . Source . Name . Should ( ) . NotBeNullOrWhiteSpace ( ) ;
270275 option . Source . ShouldAdhereToSourceSerializerWhenSet ( ) ;
271276 option . Score . Should ( ) . BeGreaterThan ( 0 ) ;
277+ option . Fields . Should ( ) . NotBeNull ( ) . And . NotBeEmpty ( ) ;
278+ option . Fields . Should ( ) . ContainKey ( "state" ) ;
272279 option . Contexts . Should ( ) . NotBeNull ( ) . And . NotBeEmpty ( ) ;
273280 option . Contexts . Should ( ) . ContainKey ( "color" ) ;
274281 var colorContexts = option . Contexts [ "color" ] ;
0 commit comments