@@ -29,9 +29,9 @@ public HighlightingUsageTests(ReadOnlyCluster cluster, EndpointUsage usage) : ba
2929 {
3030 query = new
3131 {
32- match = new JObject
32+ match = new Dictionary < string , object >
3333 {
34- { "name.standard" , new JObject
34+ { "name.standard" , new Dictionary < string , object >
3535 {
3636 { "query" , "Upton Sons Shield Rice Rowe Roberts" }
3737 }
@@ -42,9 +42,10 @@ public HighlightingUsageTests(ReadOnlyCluster cluster, EndpointUsage usage) : ba
4242 {
4343 pre_tags = new [ ] { "<tag1>" } ,
4444 post_tags = new [ ] { "</tag1>" } ,
45- fields = new JObject
45+ encoder = "html" ,
46+ fields = new Dictionary < string , object >
4647 {
47- { "name.standard" , new JObject
48+ { "name.standard" , new Dictionary < string , object >
4849 {
4950 { "type" , "plain" } ,
5051 { "force_source" , true } ,
@@ -54,17 +55,18 @@ public HighlightingUsageTests(ReadOnlyCluster cluster, EndpointUsage usage) : ba
5455 { "no_match_size" , 150 }
5556 }
5657 } ,
57- { "leadDeveloper.firstName" , new JObject
58+ { "leadDeveloper.firstName" , new Dictionary < string , object >
5859 {
5960 { "type" , "fvh" } ,
61+ { "phrase_limit" , 10 } ,
6062 { "boundary_max_scan" , 50 } ,
61- { "pre_tags" , new JArray { "<name>" } } ,
62- { "post_tags" , new JArray { "</name>" } } ,
63- { "highlight_query" , new JObject
63+ { "pre_tags" , new [ ] { "<name>" } } ,
64+ { "post_tags" , new [ ] { "</name>" } } ,
65+ { "highlight_query" , new Dictionary < string , object >
6466 {
65- { "match" , new JObject
67+ { "match" , new Dictionary < string , object >
6668 {
67- { "leadDeveloper.firstName" , new JObject
69+ { "leadDeveloper.firstName" , new Dictionary < string , object >
6870 {
6971 { "query" , "Kurt Edgardo Naomi Dariana Justice Felton" }
7072 }
@@ -75,16 +77,20 @@ public HighlightingUsageTests(ReadOnlyCluster cluster, EndpointUsage usage) : ba
7577 }
7678 }
7779 } ,
78- { "state.offsets " , new JObject
80+ { "leadDeveloper.lastName " , new Dictionary < string , object >
7981 {
80- { "type" , "postings " } ,
81- { "pre_tags" , new JArray { "<state >" } } ,
82- { "post_tags" , new JArray { "</state >" } } ,
83- { "highlight_query" , new JObject
82+ { "type" , "unified " } ,
83+ { "pre_tags" , new [ ] { "<name >" } } ,
84+ { "post_tags" , new [ ] { "</name >" } } ,
85+ { "highlight_query" , new Dictionary < string , object >
8486 {
85- { "terms " , new JObject
87+ { "match " , new Dictionary < string , object >
8688 {
87- { "state.offsets" , new JArray { "stable" , "bellyup" } }
89+ { "leadDeveloper.lastName" , new Dictionary < string , object >
90+ {
91+ { "query" , LastNameSearch }
92+ }
93+ }
8894 }
8995 }
9096 }
@@ -105,6 +111,7 @@ public HighlightingUsageTests(ReadOnlyCluster cluster, EndpointUsage usage) : ba
105111 . Highlight ( h => h
106112 . PreTags ( "<tag1>" )
107113 . PostTags ( "</tag1>" )
114+ . Encoder ( "html" )
108115 . Fields (
109116 fs => fs
110117 . Field ( p => p . Name . Suffix ( "standard" ) )
@@ -120,24 +127,22 @@ public HighlightingUsageTests(ReadOnlyCluster cluster, EndpointUsage usage) : ba
120127 . PreTags ( "<name>" )
121128 . PostTags ( "</name>" )
122129 . BoundaryMaxScan ( 50 )
130+ . PhraseLimit ( 10 )
123131 . HighlightQuery ( q => q
124132 . Match ( m => m
125133 . Field ( p => p . LeadDeveloper . FirstName )
126134 . Query ( "Kurt Edgardo Naomi Dariana Justice Felton" )
127135 )
128136 ) ,
129137 fs => fs
130- . Field ( p => p . State . Suffix ( "offsets" ) )
131- . Type ( HighlighterType . Postings )
132- . PreTags ( "<state >" )
133- . PostTags ( "</state >" )
138+ . Field ( p => p . LeadDeveloper . LastName )
139+ . Type ( HighlighterType . Unified )
140+ . PreTags ( "<name >" )
141+ . PostTags ( "</name >" )
134142 . HighlightQuery ( q => q
135- . Terms ( t => t
136- . Field ( f => f . State . Suffix ( "offsets" ) )
137- . Terms (
138- StateOfBeing . Stable . ToString ( ) . ToLowerInvariant ( ) ,
139- StateOfBeing . BellyUp . ToString ( ) . ToLowerInvariant ( )
140- )
143+ . Match ( m => m
144+ . Field ( p => p . LeadDeveloper . LastName )
145+ . Query ( LastNameSearch )
141146 )
142147 )
143148 )
@@ -155,6 +160,7 @@ public HighlightingUsageTests(ReadOnlyCluster cluster, EndpointUsage usage) : ba
155160 {
156161 PreTags = new [ ] { "<tag1>" } ,
157162 PostTags = new [ ] { "</tag1>" } ,
163+ Encoder = "html" ,
158164 Fields = new Dictionary < Field , IHighlightField >
159165 {
160166 { "name.standard" , new HighlightField
@@ -170,6 +176,7 @@ public HighlightingUsageTests(ReadOnlyCluster cluster, EndpointUsage usage) : ba
170176 { "leadDeveloper.firstName" , new HighlightField
171177 {
172178 Type = "fvh" ,
179+ PhraseLimit = 10 ,
173180 BoundaryMaxScan = 50 ,
174181 PreTags = new [ ] { "<name>" } ,
175182 PostTags = new [ ] { "</name>" } ,
@@ -180,15 +187,15 @@ public HighlightingUsageTests(ReadOnlyCluster cluster, EndpointUsage usage) : ba
180187 }
181188 }
182189 } ,
183- { "state.offsets " , new HighlightField
190+ { "leadDeveloper.lastName " , new HighlightField
184191 {
185- Type = HighlighterType . Postings ,
186- PreTags = new [ ] { "<state >" } ,
187- PostTags = new [ ] { "</state >" } ,
188- HighlightQuery = new TermsQuery
192+ Type = HighlighterType . Unified ,
193+ PreTags = new [ ] { "<name >" } ,
194+ PostTags = new [ ] { "</name >" } ,
195+ HighlightQuery = new MatchQuery
189196 {
190- Field = "state.offsets " ,
191- Terms = new [ ] { "stable" , "bellyup" }
197+ Field = "leadDeveloper.lastName " ,
198+ Query = LastNameSearch
192199 }
193200 }
194201 }
0 commit comments