mirror of
https://github.com/meilisearch/MeiliSearch
synced 2024-12-23 21:20:24 +01:00
Merge #157
157: Use <em> tags instead of <mark> tags for highlighting r=MarinPostma a=curquiza Co-authored-by: Clémentine Urquizar <clementine@meilisearch.com>
This commit is contained in:
commit
da08a1f25c
@ -158,7 +158,7 @@ impl Index {
|
|||||||
let stop_words = fst::Set::default();
|
let stop_words = fst::Set::default();
|
||||||
let highlighter = Highlighter::new(
|
let highlighter = Highlighter::new(
|
||||||
&stop_words,
|
&stop_words,
|
||||||
(String::from("<mark>"), String::from("</mark>")),
|
(String::from("<em>"), String::from("</em>")),
|
||||||
);
|
);
|
||||||
|
|
||||||
for (_id, obkv) in self.documents(&rtxn, documents_ids)? {
|
for (_id, obkv) in self.documents(&rtxn, documents_ids)? {
|
||||||
@ -386,7 +386,7 @@ mod test {
|
|||||||
let stop_words = fst::Set::default();
|
let stop_words = fst::Set::default();
|
||||||
let highlighter = Highlighter::new(
|
let highlighter = Highlighter::new(
|
||||||
&stop_words,
|
&stop_words,
|
||||||
(String::from("<mark>"), String::from("</mark>")),
|
(String::from("<em>"), String::from("</em>")),
|
||||||
);
|
);
|
||||||
|
|
||||||
let mut fields = FieldsIdsMap::new();
|
let mut fields = FieldsIdsMap::new();
|
||||||
@ -421,7 +421,7 @@ mod test {
|
|||||||
let stop_words = fst::Set::default();
|
let stop_words = fst::Set::default();
|
||||||
let highlighter = Highlighter::new(
|
let highlighter = Highlighter::new(
|
||||||
&stop_words,
|
&stop_words,
|
||||||
(String::from("<mark>"), String::from("</mark>")),
|
(String::from("<em>"), String::from("</em>")),
|
||||||
);
|
);
|
||||||
|
|
||||||
let mut fields = FieldsIdsMap::new();
|
let mut fields = FieldsIdsMap::new();
|
||||||
@ -456,7 +456,7 @@ mod test {
|
|||||||
let stop_words = fst::Set::default();
|
let stop_words = fst::Set::default();
|
||||||
let highlighter = Highlighter::new(
|
let highlighter = Highlighter::new(
|
||||||
&stop_words,
|
&stop_words,
|
||||||
(String::from("<mark>"), String::from("</mark>")),
|
(String::from("<em>"), String::from("</em>")),
|
||||||
);
|
);
|
||||||
|
|
||||||
let mut fields = FieldsIdsMap::new();
|
let mut fields = FieldsIdsMap::new();
|
||||||
@ -483,6 +483,6 @@ mod test {
|
|||||||
&to_highlight_ids
|
&to_highlight_ids
|
||||||
).unwrap();
|
).unwrap();
|
||||||
|
|
||||||
assert_eq!(value["test"], "<mark>hello</mark>");
|
assert_eq!(value["test"], "<em>hello</em>");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user