@@ -23,7 +23,7 @@ public class HighlightingUsageTests : SearchUsageTestBase
2323 {
2424 public HighlightingUsageTests ( ReadOnlyCluster cluster , EndpointUsage usage ) : base ( cluster , usage ) { }
2525
26- public string LastNameSearch { get ; } = Project . First . LeadDeveloper . LastName ;
26+ public string LastNameSearch { get ; } = Project . Instance . LeadDeveloper . LastName ;
2727
2828 protected override object ExpectJson => new
2929 {
@@ -77,20 +77,16 @@ public HighlightingUsageTests(ReadOnlyCluster cluster, EndpointUsage usage) : ba
7777 }
7878 }
7979 } ,
80- { "leadDeveloper.lastName " , new Dictionary < string , object >
80+ { "state.offsets " , new Dictionary < string , object >
8181 {
82- { "type" , "unified " } ,
83- { "pre_tags" , new [ ] { "<name >" } } ,
84- { "post_tags" , new [ ] { "</name >" } } ,
82+ { "type" , "postings " } ,
83+ { "pre_tags" , new [ ] { "<state >" } } ,
84+ { "post_tags" , new [ ] { "</state >" } } ,
8585 { "highlight_query" , new Dictionary < string , object >
8686 {
87- { "match " , new Dictionary < string , object >
87+ { "terms " , new Dictionary < string , object >
8888 {
89- { "leadDeveloper.lastName" , new Dictionary < string , object >
90- {
91- { "query" , LastNameSearch }
92- }
93- }
89+ { "state.offsets" , new [ ] { "stable" , "bellyup" } }
9490 }
9591 }
9692 }
@@ -135,14 +131,17 @@ public HighlightingUsageTests(ReadOnlyCluster cluster, EndpointUsage usage) : ba
135131 )
136132 ) ,
137133 fs => fs
138- . Field ( p => p . LeadDeveloper . LastName )
139- . Type ( HighlighterType . Unified )
140- . PreTags ( "<name >" )
141- . PostTags ( "</name >" )
134+ . Field ( p => p . State . Suffix ( "offsets" ) )
135+ . Type ( HighlighterType . Postings )
136+ . PreTags ( "<state >" )
137+ . PostTags ( "</state >" )
142138 . HighlightQuery ( q => q
143- . Match ( m => m
144- . Field ( p => p . LeadDeveloper . LastName )
145- . Query ( LastNameSearch )
139+ . Terms ( t => t
140+ . Field ( f => f . State . Suffix ( "offsets" ) )
141+ . Terms (
142+ StateOfBeing . Stable . ToString ( ) . ToLowerInvariant ( ) ,
143+ StateOfBeing . BellyUp . ToString ( ) . ToLowerInvariant ( )
144+ )
146145 )
147146 )
148147 )
@@ -187,15 +186,15 @@ public HighlightingUsageTests(ReadOnlyCluster cluster, EndpointUsage usage) : ba
187186 }
188187 }
189188 } ,
190- { "leadDeveloper.lastName " , new HighlightField
189+ { "state.offsets " , new HighlightField
191190 {
192- Type = HighlighterType . Unified ,
193- PreTags = new [ ] { "<name >" } ,
194- PostTags = new [ ] { "</name >" } ,
195- HighlightQuery = new MatchQuery
191+ Type = HighlighterType . Postings ,
192+ PreTags = new [ ] { "<state >" } ,
193+ PostTags = new [ ] { "</state >" } ,
194+ HighlightQuery = new TermsQuery
196195 {
197- Field = "leadDeveloper.lastName " ,
198- Query = LastNameSearch
196+ Field = "state.offsets " ,
197+ Terms = new [ ] { "stable" , "bellyup" }
199198 }
200199 }
201200 }
0 commit comments