mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-01-11 05:54:30 +01:00
Merge pull request #238 from meilisearch/improve-highlighting
Only highlight query words areas not the whole words
This commit is contained in:
commit
751b060320
@ -1,4 +1,5 @@
|
|||||||
use hashbrown::HashMap;
|
use hashbrown::HashMap;
|
||||||
|
use std::convert::TryFrom;
|
||||||
use std::mem;
|
use std::mem;
|
||||||
use std::ops::Range;
|
use std::ops::Range;
|
||||||
use std::rc::Rc;
|
use std::rc::Rc;
|
||||||
@ -196,7 +197,7 @@ fn fetch_raw_documents(
|
|||||||
let highlight = Highlight {
|
let highlight = Highlight {
|
||||||
attribute: di.attribute,
|
attribute: di.attribute,
|
||||||
char_index: di.char_index,
|
char_index: di.char_index,
|
||||||
char_length: di.char_length,
|
char_length: u16::try_from(*query_len).unwrap_or(u16::max_value()),
|
||||||
};
|
};
|
||||||
|
|
||||||
tmp_matches.push((di.document_id, id, match_, highlight));
|
tmp_matches.push((di.document_id, id, match_, highlight));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user