mirror of
https://github.com/meilisearch/MeiliSearch
synced 2024-11-23 13:24:27 +01:00
add tests
This commit is contained in:
parent
f9ab85adbe
commit
91363daeaa
@ -1829,3 +1829,35 @@ async fn update_documents_with_facet_distribution() {
|
|||||||
let (response2, _) = server.search_post(search).await;
|
let (response2, _) = server.search_post(search).await;
|
||||||
assert_json_eq!(expected_facet_distribution, response2["facetsDistribution"].clone());
|
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);
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user