diff --git a/meilisearch/src/search.rs b/meilisearch/src/search.rs index c287f1ba0..ebf9ace1f 100644 --- a/meilisearch/src/search.rs +++ b/meilisearch/src/search.rs @@ -378,6 +378,11 @@ pub fn perform_search( let mut tokenizer_buidler = TokenizerBuilder::default(); tokenizer_buidler.create_char_map(true); + let script_lang_map = index.script_language(&rtxn)?; + if !script_lang_map.is_empty() { + tokenizer_buidler.allow_list(&script_lang_map); + } + let mut formatter_builder = MatcherBuilder::new(matching_words, tokenizer_buidler.build()); formatter_builder.crop_marker(query.crop_marker); formatter_builder.highlight_prefix(query.highlight_pre_tag);