From 6870c4528545a5629a6e140ebcc215f9a95a1017 Mon Sep 17 00:00:00 2001 From: ManyTheFish Date: Wed, 22 Feb 2023 18:21:47 +0100 Subject: [PATCH] create a char map diring highlighting --- meilisearch/src/search.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/meilisearch/src/search.rs b/meilisearch/src/search.rs index 5cd9acee7..e02c49e47 100644 --- a/meilisearch/src/search.rs +++ b/meilisearch/src/search.rs @@ -243,9 +243,10 @@ pub fn perform_search( &displayed_ids, ); - let tokenizer = TokenizerBuilder::default().build(); + let mut tokenizer_buidler = TokenizerBuilder::default(); + tokenizer_buidler.create_char_map(true); - let mut formatter_builder = MatcherBuilder::new(matching_words, tokenizer); + 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); formatter_builder.highlight_suffix(query.highlight_post_tag);