@@ -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 {
@@ -111,6 +112,9 @@ public SuggestUsageTests(ReadOnlyCluster cluster, EndpointUsage usage) : base(cl
111112
112113 protected override Func < SearchDescriptor < Project > , ISearchRequest > Fluent => s => s
113114 . Query ( q => ProjectFilter )
115+ . DocValueFields ( d => d
116+ . Field ( f => f . State )
117+ )
114118 . Suggest ( ss => ss
115119 . Term ( "my-term-suggest" , t => t
116120 . MaxEdits ( 1 )
@@ -170,6 +174,7 @@ public SuggestUsageTests(ReadOnlyCluster cluster, EndpointUsage usage) : base(cl
170174 new SearchRequest < Project >
171175 {
172176 Query = ProjectFilter ,
177+ DocValueFields = Fields < Project > ( f => f . State ) ,
173178 Suggest = new SuggestContainer
174179 {
175180 {
@@ -271,6 +276,8 @@ protected override void ExpectResponse(ISearchResponse<Project> response)
271276 option . Source . Name . Should ( ) . NotBeNullOrWhiteSpace ( ) ;
272277 option . Source . ShouldAdhereToSourceSerializerWhenSet ( ) ;
273278 option . Score . Should ( ) . BeGreaterThan ( 0 ) ;
279+ option . Fields . Should ( ) . NotBeNull ( ) . And . NotBeEmpty ( ) ;
280+ option . Fields . Should ( ) . ContainKey ( "state" ) ;
274281 option . Contexts . Should ( ) . NotBeNull ( ) . And . NotBeEmpty ( ) ;
275282 option . Contexts . Should ( ) . ContainKey ( "color" ) ;
276283 var colorContexts = option . Contexts [ "color" ] ;
0 commit comments