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:
bors[bot] 2021-04-22 08:11:07 +00:00 committed by GitHub
commit da08a1f25c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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>");
} }
} }