File tree Expand file tree Collapse file tree 3 files changed +17
-0
lines changed Expand file tree Collapse file tree 3 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -363,6 +363,10 @@ search_parameter_guide_matching_strategy_2: |-
363
363
client.index('movies').search('big fat liar', {
364
364
matchingStrategy: 'all'
365
365
})
366
+ search_parameter_guide_matching_strategy_3 : |-
367
+ client.index('movies').search('big fat liar', {
368
+ matchingStrategy: 'frequency'
369
+ })
366
370
search_parameter_guide_hitsperpage_1 : |-
367
371
client.index('movies').search('', {
368
372
hitsPerPage: 15
Original file line number Diff line number Diff line change @@ -63,6 +63,7 @@ export type IndexesResults<T> = ResourceResults<T> & {};
63
63
export const MatchingStrategies = {
64
64
ALL : 'all' ,
65
65
LAST : 'last' ,
66
+ FREQUENCY : 'frequency' ,
66
67
} as const ;
67
68
68
69
export type MatchingStrategies =
Original file line number Diff line number Diff line change @@ -191,6 +191,18 @@ describe.each([
191
191
expect ( response . hits . length ) . toEqual ( 2 ) ;
192
192
} ) ;
193
193
194
+ test ( `${ permission } key: Basic phrase search with matchingStrategy at FREQUENCY` , async ( ) => {
195
+ const client = await getClient ( permission ) ;
196
+ const response = await client
197
+ . index ( index . uid )
198
+ . search ( 'french book' , { matchingStrategy : MatchingStrategies . FREQUENCY } ) ;
199
+
200
+ expect ( response ) . toHaveProperty ( 'hits' , expect . any ( Array ) ) ;
201
+ expect ( response ) . toHaveProperty ( 'offset' , 0 ) ;
202
+ expect ( response ) . toHaveProperty ( 'limit' , 20 ) ;
203
+ expect ( response . hits . length ) . toEqual ( 2 ) ;
204
+ } ) ;
205
+
194
206
test ( `${ permission } key: Search with query in searchParams overwriting query` , async ( ) => {
195
207
const client = await getClient ( permission ) ;
196
208
const response = await client
You can’t perform that action at this time.
0 commit comments