@@ -29,9 +29,9 @@ public HighlightingUsageTests(ReadOnlyCluster cluster, EndpointUsage usage) : ba
29
29
{
30
30
query = new
31
31
{
32
- match = new JObject
32
+ match = new Dictionary < string , object >
33
33
{
34
- { "name.standard" , new JObject
34
+ { "name.standard" , new Dictionary < string , object >
35
35
{
36
36
{ "query" , "Upton Sons Shield Rice Rowe Roberts" }
37
37
}
@@ -42,9 +42,10 @@ public HighlightingUsageTests(ReadOnlyCluster cluster, EndpointUsage usage) : ba
42
42
{
43
43
pre_tags = new [ ] { "<tag1>" } ,
44
44
post_tags = new [ ] { "</tag1>" } ,
45
- fields = new JObject
45
+ encoder = "html" ,
46
+ fields = new Dictionary < string , object >
46
47
{
47
- { "name.standard" , new JObject
48
+ { "name.standard" , new Dictionary < string , object >
48
49
{
49
50
{ "type" , "plain" } ,
50
51
{ "force_source" , true } ,
@@ -54,17 +55,18 @@ public HighlightingUsageTests(ReadOnlyCluster cluster, EndpointUsage usage) : ba
54
55
{ "no_match_size" , 150 }
55
56
}
56
57
} ,
57
- { "leadDeveloper.firstName" , new JObject
58
+ { "leadDeveloper.firstName" , new Dictionary < string , object >
58
59
{
59
60
{ "type" , "fvh" } ,
61
+ { "phrase_limit" , 10 } ,
60
62
{ "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 >
64
66
{
65
- { "match" , new JObject
67
+ { "match" , new Dictionary < string , object >
66
68
{
67
- { "leadDeveloper.firstName" , new JObject
69
+ { "leadDeveloper.firstName" , new Dictionary < string , object >
68
70
{
69
71
{ "query" , "Kurt Edgardo Naomi Dariana Justice Felton" }
70
72
}
@@ -75,16 +77,20 @@ public HighlightingUsageTests(ReadOnlyCluster cluster, EndpointUsage usage) : ba
75
77
}
76
78
}
77
79
} ,
78
- { "state.offsets " , new JObject
80
+ { "leadDeveloper.lastName " , new Dictionary < string , object >
79
81
{
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 >
84
86
{
85
- { "terms " , new JObject
87
+ { "match " , new Dictionary < string , object >
86
88
{
87
- { "state.offsets" , new JArray { "stable" , "bellyup" } }
89
+ { "leadDeveloper.lastName" , new Dictionary < string , object >
90
+ {
91
+ { "query" , LastNameSearch }
92
+ }
93
+ }
88
94
}
89
95
}
90
96
}
@@ -105,6 +111,7 @@ public HighlightingUsageTests(ReadOnlyCluster cluster, EndpointUsage usage) : ba
105
111
. Highlight ( h => h
106
112
. PreTags ( "<tag1>" )
107
113
. PostTags ( "</tag1>" )
114
+ . Encoder ( "html" )
108
115
. Fields (
109
116
fs => fs
110
117
. Field ( p => p . Name . Suffix ( "standard" ) )
@@ -120,24 +127,22 @@ public HighlightingUsageTests(ReadOnlyCluster cluster, EndpointUsage usage) : ba
120
127
. PreTags ( "<name>" )
121
128
. PostTags ( "</name>" )
122
129
. BoundaryMaxScan ( 50 )
130
+ . PhraseLimit ( 10 )
123
131
. HighlightQuery ( q => q
124
132
. Match ( m => m
125
133
. Field ( p => p . LeadDeveloper . FirstName )
126
134
. Query ( "Kurt Edgardo Naomi Dariana Justice Felton" )
127
135
)
128
136
) ,
129
137
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 >" )
134
142
. 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 )
141
146
)
142
147
)
143
148
)
@@ -155,6 +160,7 @@ public HighlightingUsageTests(ReadOnlyCluster cluster, EndpointUsage usage) : ba
155
160
{
156
161
PreTags = new [ ] { "<tag1>" } ,
157
162
PostTags = new [ ] { "</tag1>" } ,
163
+ Encoder = "html" ,
158
164
Fields = new Dictionary < Field , IHighlightField >
159
165
{
160
166
{ "name.standard" , new HighlightField
@@ -170,6 +176,7 @@ public HighlightingUsageTests(ReadOnlyCluster cluster, EndpointUsage usage) : ba
170
176
{ "leadDeveloper.firstName" , new HighlightField
171
177
{
172
178
Type = "fvh" ,
179
+ PhraseLimit = 10 ,
173
180
BoundaryMaxScan = 50 ,
174
181
PreTags = new [ ] { "<name>" } ,
175
182
PostTags = new [ ] { "</name>" } ,
@@ -180,15 +187,15 @@ public HighlightingUsageTests(ReadOnlyCluster cluster, EndpointUsage usage) : ba
180
187
}
181
188
}
182
189
} ,
183
- { "state.offsets " , new HighlightField
190
+ { "leadDeveloper.lastName " , new HighlightField
184
191
{
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
189
196
{
190
- Field = "state.offsets " ,
191
- Terms = new [ ] { "stable" , "bellyup" }
197
+ Field = "leadDeveloper.lastName " ,
198
+ Query = LastNameSearch
192
199
}
193
200
}
194
201
}
0 commit comments