test setting attributes before adding documents
@@ -1195,15 +1195,21 @@ async fn search_with_differents_attributes_8() {
#[actix_rt::test]
async fn test_faceted_search_valid() {
- let mut server = common::Server::test_server().await;
+ // set facetting attributes before adding documents
+ let mut server = common::Server::with_uid("test");
+ server.create_index(json!({ "uid": "test" })).await;
- // simple tests on attributes with string value
let body = json!({
"attributesForFaceting": ["color"]
});
-
server.update_all_settings(body).await;
+ let dataset = include_bytes!("assets/test_set.json");
+ let body: Value = serde_json::from_slice(dataset).unwrap();
+ server.add_or_update_multiple_documents(body).await;
+
+ // simple tests on attributes with string value
+
let query = json!({
"q": "a",
"facetFilters": ["color:green"]
