@@ -23,7 +23,7 @@ public class HighlightingUsageTests : SearchUsageTestBase
23
23
{
24
24
public HighlightingUsageTests ( ReadOnlyCluster cluster , EndpointUsage usage ) : base ( cluster , usage ) { }
25
25
26
- public string LastNameSearch { get ; } = Project . First . LeadDeveloper . LastName ;
26
+ public string LastNameSearch { get ; } = Project . Instance . LeadDeveloper . LastName ;
27
27
28
28
protected override object ExpectJson => new
29
29
{
@@ -77,20 +77,16 @@ public HighlightingUsageTests(ReadOnlyCluster cluster, EndpointUsage usage) : ba
77
77
}
78
78
}
79
79
} ,
80
- { "leadDeveloper.lastName " , new Dictionary < string , object >
80
+ { "state.offsets " , new Dictionary < string , object >
81
81
{
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 >" } } ,
85
85
{ "highlight_query" , new Dictionary < string , object >
86
86
{
87
- { "match " , new Dictionary < string , object >
87
+ { "terms " , new Dictionary < string , object >
88
88
{
89
- { "leadDeveloper.lastName" , new Dictionary < string , object >
90
- {
91
- { "query" , LastNameSearch }
92
- }
93
- }
89
+ { "state.offsets" , new [ ] { "stable" , "bellyup" } }
94
90
}
95
91
}
96
92
}
@@ -135,14 +131,17 @@ public HighlightingUsageTests(ReadOnlyCluster cluster, EndpointUsage usage) : ba
135
131
)
136
132
) ,
137
133
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 >" )
142
138
. 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
+ )
146
145
)
147
146
)
148
147
)
@@ -187,15 +186,15 @@ public HighlightingUsageTests(ReadOnlyCluster cluster, EndpointUsage usage) : ba
187
186
}
188
187
}
189
188
} ,
190
- { "leadDeveloper.lastName " , new HighlightField
189
+ { "state.offsets " , new HighlightField
191
190
{
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
196
195
{
197
- Field = "leadDeveloper.lastName " ,
198
- Query = LastNameSearch
196
+ Field = "state.offsets " ,
197
+ Terms = new [ ] { "stable" , "bellyup" }
199
198
}
200
199
}
201
200
}
0 commit comments