Don't create partial matching words for synonyms in ngrams

This commit is contained in:
Loïc Lecrenier 2022-11-28 16:32:28 +01:00
parent f70856bab1
commit 61b58b115a

View File

@ -693,11 +693,13 @@ fn create_matching_words(
if let Some(synonyms) = ctx.synonyms(&words)? {
for synonym in synonyms {
let synonym = synonym
if let Some(synonym) = synonym
.into_iter()
.flat_map(|syn| matching_word_cache.insert(syn, 0, false))
.collect();
matching_words.push((synonym, ids.clone()));
.map(|syn| matching_word_cache.insert(syn, 0, false))
.collect()
{
matching_words.push((synonym, ids.clone()));
}
}
}
let word = words.concat();