From 84a5c304fc78d85652897182cc66a85a454c0579 Mon Sep 17 00:00:00 2001 From: Louis Dureuil Date: Thu, 11 Jan 2024 21:35:06 +0100 Subject: [PATCH] Don't display the embedders setting when it is an empty dict --- meilisearch-types/src/settings.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/meilisearch-types/src/settings.rs b/meilisearch-types/src/settings.rs index 9613cb9f3..ca46abb0c 100644 --- a/meilisearch-types/src/settings.rs +++ b/meilisearch-types/src/settings.rs @@ -600,11 +600,12 @@ pub fn settings( ), }; - let embedders = index + let embedders: BTreeMap<_, _> = index .embedding_configs(rtxn)? .into_iter() .map(|(name, config)| (name, Setting::Set(config.into()))) .collect(); + let embedders = if embedders.is_empty() { Setting::NotSet } else { Setting::Set(embedders) }; Ok(Settings { displayed_attributes: match displayed_attributes { @@ -631,7 +632,7 @@ pub fn settings( typo_tolerance: Setting::Set(typo_tolerance), faceting: Setting::Set(faceting), pagination: Setting::Set(pagination), - embedders: Setting::Set(embedders), + embedders, _kind: PhantomData, }) }