diff --git a/meilisearch-http/src/data/mod.rs b/meilisearch-http/src/data/mod.rs
index ed5ce4952..15db0e4ae 100644
--- a/meilisearch-http/src/data/mod.rs
+++ b/meilisearch-http/src/data/mod.rs
@@ -106,11 +106,17 @@ impl Data {
.map(|(k, v)| (k, v.to_string()))
.collect();
+ let criteria = index
+ .criteria(&txn)?
+ .into_iter()
+ .map(|v| format!("{:?}", v))
+ .collect();
+
Ok(Settings {
displayed_attributes: Some(Some(displayed_attributes)),
searchable_attributes: Some(Some(searchable_attributes)),
faceted_attributes: Some(Some(faceted_attributes)),
- criteria: None,
+ ranking_rules: Some(Some(criteria)),
})
}
diff --git a/meilisearch-http/src/index_controller/local_index_controller/update_handler.rs b/meilisearch-http/src/index_controller/local_index_controller/update_handler.rs
index 5781a2806..ab2e75206 100644
--- a/meilisearch-http/src/index_controller/local_index_controller/update_handler.rs
+++ b/meilisearch-http/src/index_controller/local_index_controller/update_handler.rs
@@ -153,7 +153,7 @@ impl UpdateHandler {
}
// We transpose the settings JSON struct into a real setting update.
- if let Some(ref criteria) = settings.criteria {
+ if let Some(ref criteria) = settings.ranking_rules {
match criteria {
Some(criteria) => builder.set_criteria(criteria.clone()),
None => builder.reset_criteria(),
diff --git a/meilisearch-http/src/index_controller/mod.rs b/meilisearch-http/src/index_controller/mod.rs
index b20e43749..fc8efa036 100644
--- a/meilisearch-http/src/index_controller/mod.rs
+++ b/meilisearch-http/src/index_controller/mod.rs
@@ -83,7 +83,7 @@ pub struct Settings {
deserialize_with = "deserialize_some",
skip_serializing_if = "Option::is_none",
)]
- pub criteria: Option