mirror of
https://github.com/meilisearch/meilisearch.git
synced 2024-11-27 04:25:06 +08:00
Don't create partial matching words for synonyms in ngrams
This commit is contained in:
parent
f70856bab1
commit
61b58b115a
@ -693,13 +693,15 @@ fn create_matching_words(
|
|||||||
|
|
||||||
if let Some(synonyms) = ctx.synonyms(&words)? {
|
if let Some(synonyms) = ctx.synonyms(&words)? {
|
||||||
for synonym in synonyms {
|
for synonym in synonyms {
|
||||||
let synonym = synonym
|
if let Some(synonym) = synonym
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.flat_map(|syn| matching_word_cache.insert(syn, 0, false))
|
.map(|syn| matching_word_cache.insert(syn, 0, false))
|
||||||
.collect();
|
.collect()
|
||||||
|
{
|
||||||
matching_words.push((synonym, ids.clone()));
|
matching_words.push((synonym, ids.clone()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
let word = words.concat();
|
let word = words.concat();
|
||||||
let (word_len_one_typo, word_len_two_typo) =
|
let (word_len_one_typo, word_len_two_typo) =
|
||||||
ctx.min_word_len_for_typo()?;
|
ctx.min_word_len_for_typo()?;
|
||||||
|
Loading…
Reference in New Issue
Block a user