Don't display the embedders setting when it is an empty dict

This commit is contained in:
Louis Dureuil 2024-01-11 21:35:06 +01:00
parent e93d36d5b9
commit 84a5c304fc
No known key found for this signature in database

View File

@ -600,11 +600,12 @@ pub fn settings(
), ),
}; };
let embedders = index let embedders: BTreeMap<_, _> = index
.embedding_configs(rtxn)? .embedding_configs(rtxn)?
.into_iter() .into_iter()
.map(|(name, config)| (name, Setting::Set(config.into()))) .map(|(name, config)| (name, Setting::Set(config.into())))
.collect(); .collect();
let embedders = if embedders.is_empty() { Setting::NotSet } else { Setting::Set(embedders) };
Ok(Settings { Ok(Settings {
displayed_attributes: match displayed_attributes { displayed_attributes: match displayed_attributes {
@ -631,7 +632,7 @@ pub fn settings(
typo_tolerance: Setting::Set(typo_tolerance), typo_tolerance: Setting::Set(typo_tolerance),
faceting: Setting::Set(faceting), faceting: Setting::Set(faceting),
pagination: Setting::Set(pagination), pagination: Setting::Set(pagination),
embedders: Setting::Set(embedders), embedders,
_kind: PhantomData, _kind: PhantomData,
}) })
} }