implements the synonyms in transplant

This commit is contained in:
Tamo 2021-06-03 14:19:56 +02:00 committed by marin postma
parent b119bb4ab0
commit 18d4d6097a
No known key found for this signature in database
GPG key ID: 6088B7721C3E39F9
8 changed files with 50 additions and 56 deletions

View file

@ -133,9 +133,6 @@ fn load_index(
/// we need to **always** be able to convert the old settings to the settings currently being used
impl From<Settings> for index_controller::Settings<Unchecked> {
fn from(settings: Settings) -> Self {
if settings.synonyms.flatten().is_some() {
error!("`synonyms` are not yet implemented and thus will be ignored");
}
Self {
distinct_attribute: settings.distinct_attribute,
// we need to convert the old `Vec<String>` into a `BTreeSet<String>`
@ -167,6 +164,8 @@ impl From<Settings> for index_controller::Settings<Unchecked> {
}).collect())),
// we need to convert the old `Vec<String>` into a `BTreeSet<String>`
stop_words: settings.stop_words.map(|o| o.map(|vec| vec.into_iter().collect())),
// we need to convert the old `Vec<String>` into a `BTreeMap<String>`
synonyms: settings.synonyms.map(|o| o.map(|vec| vec.into_iter().collect())),
_kind: PhantomData,
}
}