From 00b0a00fc5a8d3aeb088260fb252d8d214d58a27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9mentine=20Urquizar?= Date: Wed, 23 Jun 2021 11:05:30 +0200 Subject: [PATCH] Add exhaustiveFacetsCount --- meilisearch-http/src/index/search.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/meilisearch-http/src/index/search.rs b/meilisearch-http/src/index/search.rs index 507273dde..d4510a115 100644 --- a/meilisearch-http/src/index/search.rs +++ b/meilisearch-http/src/index/search.rs @@ -74,6 +74,8 @@ pub struct SearchResult { pub processing_time_ms: u128, #[serde(skip_serializing_if = "Option::is_none")] pub facets_distribution: Option>>, + #[serde(skip_serializing_if = "Option::is_none")] + pub exhaustive_facets_count: Option, } #[derive(Copy, Clone)] @@ -211,6 +213,11 @@ impl Index { None => None, }; + let exhaustive_facets_count = match facets_distribution { + Some(_) => Some(false), // not implemented yet + None => None + }; + let result = SearchResult { exhaustive_nb_hits: false, // not implemented yet hits: documents, @@ -220,6 +227,7 @@ impl Index { offset: query.offset.unwrap_or_default(), processing_time_ms: before_search.elapsed().as_millis(), facets_distribution, + exhaustive_facets_count, }; Ok(result) }