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
8 changed files with 50 additions and 56 deletions

View File

@ -84,6 +84,17 @@ impl Index {
.unwrap_or_else(BTreeSet::new);
let distinct_field = self.distinct_field(&txn)?.map(String::from);
let synonyms = self
.synonyms(&txn)?
.iter()
.map(|(key, values)| {
(
key.join(" "),
values.iter().map(|value| value.join(" ")).collect(),
)
})
.collect();
Ok(Settings {
displayed_attributes: Some(displayed_attributes),
searchable_attributes: Some(searchable_attributes),
@ -91,6 +102,7 @@ impl Index {
ranking_rules: Some(Some(criteria)),
stop_words: Some(Some(stop_words)),
distinct_attribute: Some(distinct_field),
synonyms: Some(Some(synonyms)),
_kind: PhantomData,
})
}