mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-04 12:27:13 +02:00
Use fst 0.4.4 in the project
This commit is contained in:
parent
6c87723b19
commit
bc7b0a38fd
16 changed files with 178 additions and 241 deletions
|
@ -63,20 +63,18 @@ async fn get_all(
|
|||
let reader = data.db.main_read_txn()?;
|
||||
|
||||
let stop_words_fst = index.main.stop_words_fst(&reader)?;
|
||||
let stop_words = stop_words_fst.unwrap_or_default().stream().into_strs()?;
|
||||
let stop_words = stop_words_fst.stream().into_strs()?;
|
||||
let stop_words: BTreeSet<String> = stop_words.into_iter().collect();
|
||||
|
||||
let synonyms_fst = index.main.synonyms_fst(&reader)?.unwrap_or_default();
|
||||
let synonyms_fst = index.main.synonyms_fst(&reader)?;
|
||||
let synonyms_list = synonyms_fst.stream().into_strs()?;
|
||||
|
||||
let mut synonyms = BTreeMap::new();
|
||||
let index_synonyms = &index.synonyms;
|
||||
for synonym in synonyms_list {
|
||||
let alternative_list = index_synonyms.synonyms(&reader, synonym.as_bytes())?;
|
||||
if let Some(list) = alternative_list {
|
||||
let list = list.stream().into_strs()?;
|
||||
synonyms.insert(synonym, list);
|
||||
}
|
||||
let list = alternative_list.stream().into_strs()?;
|
||||
synonyms.insert(synonym, list);
|
||||
}
|
||||
|
||||
let ranking_rules = index
|
||||
|
|
|
@ -26,7 +26,7 @@ async fn get(
|
|||
.ok_or(ResponseError::index_not_found(&path.index_uid))?;
|
||||
let reader = data.db.main_read_txn()?;
|
||||
let stop_words_fst = index.main.stop_words_fst(&reader)?;
|
||||
let stop_words = stop_words_fst.unwrap_or_default().stream().into_strs()?;
|
||||
let stop_words = stop_words_fst.stream().into_strs()?;
|
||||
|
||||
Ok(HttpResponse::Ok().json(stop_words))
|
||||
}
|
||||
|
|
|
@ -29,18 +29,15 @@ async fn get(
|
|||
|
||||
let reader = data.db.main_read_txn()?;
|
||||
|
||||
let synonyms_fst = index.main.synonyms_fst(&reader)?.unwrap_or_default();
|
||||
let synonyms_fst = index.main.synonyms_fst(&reader)?;
|
||||
let synonyms_list = synonyms_fst.stream().into_strs()?;
|
||||
|
||||
let mut synonyms = IndexMap::new();
|
||||
let index_synonyms = &index.synonyms;
|
||||
for synonym in synonyms_list {
|
||||
let alternative_list = index_synonyms.synonyms(&reader, synonym.as_bytes())?;
|
||||
|
||||
if let Some(list) = alternative_list {
|
||||
let list = list.stream().into_strs()?;
|
||||
synonyms.insert(synonym, list);
|
||||
}
|
||||
let list = alternative_list.stream().into_strs()?;
|
||||
synonyms.insert(synonym, list);
|
||||
}
|
||||
|
||||
Ok(HttpResponse::Ok().json(synonyms))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue