From d9a29cae608e68f1b1128e96dfe139f64e08052b Mon Sep 17 00:00:00 2001 From: Marin Postma Date: Tue, 20 Apr 2021 16:21:30 +0200 Subject: [PATCH] fix ignored displayed attributes --- meilisearch-http/src/index/search.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/meilisearch-http/src/index/search.rs b/meilisearch-http/src/index/search.rs index 4f796476c..2af626875 100644 --- a/meilisearch-http/src/index/search.rs +++ b/meilisearch-http/src/index/search.rs @@ -88,7 +88,9 @@ impl Index { let mut documents = Vec::new(); let fields_ids_map = self.fields_ids_map(&rtxn).unwrap(); - let displayed_ids: HashSet = fields_ids_map.iter().map(|(id, _)| id).collect(); + let displayed_ids: HashSet = self.displayed_fields_ids(&rtxn)? + .map(|fields| fields.into_iter().collect::>()) + .unwrap_or_else(|| fields_ids_map.iter().map(|(id, _)| id).collect()); let fids = |attrs: &HashSet| { let mut ids = HashSet::new();