Plug the faceting.max_values_per_facet setting

This commit is contained in:
Kerollmops
2022-06-08 18:03:56 +02:00
parent 5450b5ced3
commit b96399d24b
6 changed files with 45 additions and 20 deletions

View File

@ -24,6 +24,12 @@ static DEFAULT_SETTINGS_VALUES: Lazy<HashMap<&'static str, Value>> = Lazy::new(|
);
map.insert("stop_words", json!([]));
map.insert("synonyms", json!({}));
map.insert(
"faceting",
json!({
"maxValuesByFacet": json!(100),
}),
);
map
});
@ -43,7 +49,7 @@ async fn get_settings() {
let (response, code) = index.settings().await;
assert_eq!(code, 200);
let settings = response.as_object().unwrap();
assert_eq!(settings.keys().len(), 9);
assert_eq!(settings.keys().len(), 10);
assert_eq!(settings["displayedAttributes"], json!(["*"]));
assert_eq!(settings["searchableAttributes"], json!(["*"]));
assert_eq!(settings["filterableAttributes"], json!([]));
@ -61,6 +67,12 @@ async fn get_settings() {
])
);
assert_eq!(settings["stopWords"], json!([]));
assert_eq!(
settings["faceting"],
json!({
"maxValuesPerFacet": 100
})
);
}
#[actix_rt::test]