File tree Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Expand file tree Collapse file tree 2 files changed +13
-0
lines changed 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 . index ( index . uid ) . search ( 'french book' , {
197
+ matchingStrategy : MatchingStrategies . FREQUENCY ,
198
+ } ) ;
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