From b1528f946651c45565f18e05b264495177e3aca1 Mon Sep 17 00:00:00 2001 From: Quentin de Quelen Date: Fri, 24 Jan 2020 11:29:08 +0100 Subject: [PATCH] allow to see highlihts with matches and crop; fix #450 #449 --- meilisearch-http/src/helpers/meilisearch.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/meilisearch-http/src/helpers/meilisearch.rs b/meilisearch-http/src/helpers/meilisearch.rs index af66e186c..74a8ed2df 100644 --- a/meilisearch-http/src/helpers/meilisearch.rs +++ b/meilisearch-http/src/helpers/meilisearch.rs @@ -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 };