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> & {};
6363export const MatchingStrategies = {
6464 ALL : 'all' ,
6565 LAST : 'last' ,
66+ FREQUENCY : 'frequency' ,
6667} as const ;
6768
6869export type MatchingStrategies =
Original file line number Diff line number Diff line change @@ -191,6 +191,18 @@ describe.each([
191191 expect ( response . hits . length ) . toEqual ( 2 ) ;
192192 } ) ;
193193
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+
194206 test ( `${ permission } key: Search with query in searchParams overwriting query` , async ( ) => {
195207 const client = await getClient ( permission ) ;
196208 const response = await client
You can’t perform that action at this time.
0 commit comments