add test to reproduce #891 bug report

fix bug
This commit is contained in:
many
2020-08-31 18:15:07 +02:00
committed by mpostma
parent ac7226bb27
commit 1639a7338d
6 changed files with 115 additions and 21 deletions

View File

@ -1779,8 +1779,8 @@ async fn update_documents_with_facet_distribution() {
server.create_index(body).await;
let settings = json!({
"attributesForFaceting": ["genre"],
"displayedAttributes": ["genre"],
"searchableAttributes": ["genre"]
"displayedAttributes": ["genre", "type"],
"searchableAttributes": ["genre", "type"]
});
server.update_all_settings(settings).await;
let update1 = json!([
@ -1809,6 +1809,7 @@ async fn update_documents_with_facet_distribution() {
"facetsDistribution": ["genre"]
});
let (response1, _) = server.search_post(search.clone()).await;
println!("response1: {}", response1);
let expected_facet_distribution = json!({
"genre": {
"grunge": 1,
@ -1827,5 +1828,6 @@ async fn update_documents_with_facet_distribution() {
]);
server.add_or_update_multiple_documents(update2).await;
let (response2, _) = server.search_post(search).await;
println!("response2: {}", response2);
assert_json_eq!(expected_facet_distribution, response2["facetsDistribution"].clone());
}