diff --git a/meilisearch-http/tests/assets/dumps/v1/test/updates.jsonl b/meilisearch-http/tests/assets/dumps/v1/test/updates.jsonl index 0dcffdce0..5bba3b9f0 100644 --- a/meilisearch-http/tests/assets/dumps/v1/test/updates.jsonl +++ b/meilisearch-http/tests/assets/dumps/v1/test/updates.jsonl @@ -1,2 +1,3 @@ -{"status": "processed","updateId": 0,"type": {"name":"Settings","settings":{"ranking_rules":{"Update":["Typo","Words","Proximity","Attribute","WordsPosition","Exactness"]},"distinct_attribute":"Nothing","primary_key":"Nothing","searchable_attributes":{"Update":["balance","picture","age","color","name","gender","email","phone","address","about","registered","latitude","longitude","tags"]},"displayed_attributes":{"Update":["about","address","age","balance","color","email","gender","id","isActive","latitude","longitude","name","phone","picture","registered","tags"]},"stop_words":"Nothing","synonyms":"Nothing","attributes_for_faceting":"Nothing"}}} -{"status": "processed", "updateId": 1, "type": { "name": "DocumentsAddition"}} \ No newline at end of file +{"status":"processed","updateId":0,"type":{"name":"Settings","settings":{"ranking_rules":{"Update":["Typo","Words","Proximity","Attribute","WordsPosition","Exactness"]},"distinct_attribute":"Nothing","primary_key":"Nothing","searchable_attributes":"Nothing","displayed_attributes":"Nothing","stop_words":"Nothing","synonyms":"Nothing","attributes_for_faceting":"Nothing"}}} +{"status":"processed","updateId":1,"type":{"name":"DocumentsAddition","number":77}} + diff --git a/meilisearch-http/tests/common.rs b/meilisearch-http/tests/common.rs index 43cea1447..9111dc9f1 100644 --- a/meilisearch-http/tests/common.rs +++ b/meilisearch-http/tests/common.rs @@ -88,40 +88,6 @@ impl Server { "wordsPosition", "exactness", ], - "searchableAttributes": [ - "balance", - "picture", - "age", - "color", - "name", - "gender", - "email", - "phone", - "address", - "about", - "registered", - "latitude", - "longitude", - "tags", - ], - "displayedAttributes": [ - "id", - "isActive", - "balance", - "picture", - "age", - "color", - "name", - "gender", - "email", - "phone", - "address", - "about", - "registered", - "latitude", - "longitude", - "tags", - ], }); server.update_all_settings(body).await; diff --git a/meilisearch-http/tests/dump.rs b/meilisearch-http/tests/dump.rs index 701b754aa..5ab5db0db 100644 --- a/meilisearch-http/tests/dump.rs +++ b/meilisearch-http/tests/dump.rs @@ -132,6 +132,8 @@ async fn get_dump_status_should_return_done() { let (value, status_code) = server.trigger_dump().await; + println!("value: {:#?}", value); + assert_eq!(status_code, 202); let dump_uid = value["uid"].as_str().unwrap().to_string(); @@ -367,20 +369,10 @@ async fn dump_index_updates_should_be_valid() { compression::from_tar_gz(&dumps_dir.join(&format!("{}.dump", uid)), tmp_dir_path).unwrap(); let file = File::open(tmp_dir_path.join("test").join("updates.jsonl")).unwrap(); - let mut updates = read_all_jsonline(file); + let updates = read_all_jsonline(file); - - // hotfix until #943 is fixed (https://github.com/meilisearch/MeiliSearch/issues/943) - updates.as_array_mut().unwrap() - .get_mut(0).unwrap() - .get_mut("type").unwrap() - .get_mut("settings").unwrap() - .get_mut("displayed_attributes").unwrap() - .get_mut("Update").unwrap() - .as_array_mut().unwrap().sort_by(|a, b| a.as_str().cmp(&b.as_str())); - - eprintln!("{}\n", updates.to_string()); - eprintln!("{}", expected.to_string()); + eprintln!("{}\n", updates); + eprintln!("{}", expected); assert_json_include!(expected: expected, actual: updates); } diff --git a/meilisearch-http/tests/index.rs b/meilisearch-http/tests/index.rs index 271507e03..050ffe813 100644 --- a/meilisearch-http/tests/index.rs +++ b/meilisearch-http/tests/index.rs @@ -779,30 +779,32 @@ async fn update_existing_primary_key_is_error() { } #[actix_rt::test] -async fn test_facets_distribution_attribute() { +async fn test_field_distribution_attribute() { let mut server = common::Server::test_server().await; let (response, _status_code) = server.get_index_stats().await; let expected = json!({ - "isIndexing": false, - "numberOfDocuments":77, - "fieldsDistribution":{ - "age":77, - "gender":77, - "phone":77, - "name":77, - "registered":77, - "latitude":77, - "email":77, - "tags":77, - "longitude":77, - "color":77, - "address":77, - "balance":77, - "about":77, - "picture":77, + "fieldsDistribution": { + "about": 77, + "address": 77, + "age": 77, + "balance": 77, + "color": 77, + "email": 77, + "gender": 77, + "id": 77, + "isActive": 77, + "latitude": 77, + "longitude": 77, + "name": 77, + "phone": 77, + "picture": 77, + "registered": 77, + "tags": 77 }, + "isIndexing": false, + "numberOfDocuments": 77 }); assert_json_eq!(expected, response, ordered: true); diff --git a/meilisearch-http/tests/search.rs b/meilisearch-http/tests/search.rs index 1d1a60678..6a496809e 100644 --- a/meilisearch-http/tests/search.rs +++ b/meilisearch-http/tests/search.rs @@ -1789,8 +1789,6 @@ async fn update_documents_with_facet_distribution() { server.create_index(body).await; let settings = json!({ "attributesForFaceting": ["genre"], - "displayedAttributes": ["genre"], - "searchableAttributes": ["genre"] }); server.update_all_settings(settings).await; let update1 = json!([