allow to see highlihts with matches and crop; fix #450 #449

This commit is contained in:
Quentin de Quelen 2020-01-24 11:29:08 +01:00 committed by qdequele
parent 7a491a64c0
commit b1528f9466
No known key found for this signature in database
GPG Key ID: B3F0A000EBF11745

View File

@ -239,10 +239,8 @@ impl<'a> SearchBuilder<'a> {
// Transform to readable matches
let matches = calculate_matches(matches, self.attributes_to_retrieve.clone(), &schema);
if !self.matches {
if let Some(attributes_to_highlight) = &self.attributes_to_highlight {
formatted = calculate_highlights(&formatted, &matches, attributes_to_highlight);
}
if let Some(attributes_to_highlight) = &self.attributes_to_highlight {
formatted = calculate_highlights(&formatted, &matches, attributes_to_highlight);
}
let matches_info = if self.matches { Some(matches) } else { None };