diff --git a/meilisearch-http/tests/search.rs b/meilisearch-http/tests/search.rs index 92879bb7b..3cce31972 100644 --- a/meilisearch-http/tests/search.rs +++ b/meilisearch-http/tests/search.rs @@ -1829,3 +1829,35 @@ async fn update_documents_with_facet_distribution() { let (response2, _) = server.search_post(search).await; assert_json_eq!(expected_facet_distribution, response2["facetsDistribution"].clone()); } + +#[actix_rt::test] +async fn test_search_synonyms_unicased() { + let mut server = common::Server::with_uid("test"); + let body = json!({ "uid": "test" }); + server.create_index(body).await; + let settings = json!({ + "synonyms": { + "cáse": ["truc"], + "case": ["machin"] + } + }); + server.update_all_settings(settings).await; + + let (response, _) = server.get_synonyms().await; + println!("response: {}", response); + assert_json_eq!(response, json!({"case":["machin", "truc"]})); + + let update = json!([ + { + "id": "1", + "title": "truc" + }, + ]); + server.add_or_update_multiple_documents(update).await; + + let search = json!({ + "q": "case", + }); + let (response, _) = server.search_post(search).await; + assert_eq!(response["hits"].as_array().unwrap().len(), 1); +}