File tree Expand file tree Collapse file tree 2 files changed +27
-1
lines changed Expand file tree Collapse file tree 2 files changed +27
-1
lines changed Original file line number Diff line number Diff line change @@ -867,6 +867,15 @@ search_parameter_guide_matching_strategy_2: |-
867867 .execute()
868868 .await
869869 .unwrap();
870+ search_parameter_guide_matching_strategy_3 : |-
871+ let results: SearchResults<Movie> = client
872+ .index("movies")
873+ .search()
874+ .with_query("white shirt")
875+ .with_matching_strategy(MatchingStrategies::FREQUENCY)
876+ .execute()
877+ .await
878+ .unwrap();
870879search_parameter_guide_hitsperpage_1 : |-
871880 client.index("movies").search().with_hits_per_page(15).execute().await?;
872881search_parameter_guide_page_1 : |-
Original file line number Diff line number Diff line change @@ -32,6 +32,8 @@ pub enum MatchingStrategies {
3232 ALL ,
3333 #[ serde( rename = "last" ) ]
3434 LAST ,
35+ #[ serde( rename = "frequency" ) ]
36+ FREQUENCY ,
3537}
3638
3739/// A single result.
@@ -1151,7 +1153,7 @@ mod tests {
11511153 }
11521154
11531155 #[ meilisearch_test]
1154- async fn test_matching_strategy_left ( client : Client , index : Index ) -> Result < ( ) , Error > {
1156+ async fn test_matching_strategy_last ( client : Client , index : Index ) -> Result < ( ) , Error > {
11551157 setup_test_index ( & client, & index) . await ?;
11561158
11571159 let results = SearchQuery :: new ( & index)
@@ -1165,6 +1167,21 @@ mod tests {
11651167 Ok ( ( ) )
11661168 }
11671169
1170+ #[ meilisearch_test]
1171+ async fn test_matching_strategy_frequency ( client : Client , index : Index ) -> Result < ( ) , Error > {
1172+ setup_test_index ( & client, & index) . await ?;
1173+
1174+ let results = SearchQuery :: new ( & index)
1175+ . with_query ( "Harry Styles" )
1176+ . with_matching_strategy ( MatchingStrategies :: FREQUENCY )
1177+ . execute :: < Document > ( )
1178+ . await
1179+ . unwrap ( ) ;
1180+
1181+ assert_eq ! ( results. hits. len( ) , 7 ) ;
1182+ Ok ( ( ) )
1183+ }
1184+
11681185 #[ meilisearch_test]
11691186 async fn test_generate_tenant_token_from_client (
11701187 client : Client ,
You can’t perform that action at this time.
0 commit comments