mirror of
https://github.com/meilisearch/meilisearch.git
synced 2024-11-30 09:04:59 +08:00
Fix highlight by replacing num_graphemes_from_bytes
num_graphemes_from_bytes has been renamed in the tokenizer to num_chars_from_bytes. Highlight now works correctly!
This commit is contained in:
parent
c10f58b7bd
commit
5ab505be33
@ -40,11 +40,11 @@ impl MatchingWords {
|
|||||||
Distance::Exact(t) if t <= *typo => {
|
Distance::Exact(t) if t <= *typo => {
|
||||||
if *is_prefix {
|
if *is_prefix {
|
||||||
let len = bytes_to_highlight(word_to_highlight.text(), query_word);
|
let len = bytes_to_highlight(word_to_highlight.text(), query_word);
|
||||||
Some(word_to_highlight.num_graphemes_from_bytes(len))
|
Some(word_to_highlight.num_chars_from_bytes(len))
|
||||||
} else {
|
} else {
|
||||||
Some(
|
Some(
|
||||||
word_to_highlight
|
word_to_highlight
|
||||||
.num_graphemes_from_bytes(word_to_highlight.text().len()),
|
.num_chars_from_bytes(word_to_highlight.text().len()),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user