From eaa535a27c0a15314f4e3003820fae6e8573d162 Mon Sep 17 00:00:00 2001 From: cvermand <33010418+bidoubiwa@users.noreply.github.com> Date: Mon, 20 Mar 2023 10:39:29 +0100 Subject: [PATCH] Add facetstats for Meilisearch v1.1.0 (#443) * Failing tests due to breaking patch in mockito * Add facetstats for Meilisearch v1.1.0 * Update src/tasks.rs --------- Co-authored-by: bors[bot] <26634292+bors[bot]@users.noreply.github.com> --- src/search.rs | 8 ++++++++ src/tasks.rs | 1 - 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/search.rs b/src/search.rs index f4613c2d..534c80a7 100644 --- a/src/search.rs +++ b/src/search.rs @@ -46,6 +46,12 @@ pub struct SearchResult { pub matches_position: Option>>, } +#[derive(Deserialize, Debug)] +#[serde(rename_all = "camelCase")] +pub struct FacetStats { + pub min: u32, + pub max: u32, +} #[derive(Deserialize, Debug)] #[serde(rename_all = "camelCase")] /// A struct containing search results and other information about the search. @@ -68,6 +74,8 @@ pub struct SearchResults { pub total_pages: Option, /// Distribution of the given facets pub facet_distribution: Option>>, + /// facet stats of the numerical facets requested in the `facet` search parameter. + pub facet_stats: Option>, /// Processing time of the query pub processing_time_ms: usize, /// Query originating the response diff --git a/src/tasks.rs b/src/tasks.rs index 370d23c6..04e381b3 100644 --- a/src/tasks.rs +++ b/src/tasks.rs @@ -1060,7 +1060,6 @@ mod test { #[meilisearch_test] async fn test_delete_tasks_with_params() -> Result<(), Error> { let mut s = mockito::Server::new_async().await; - // let mut s = mockito::Server::new_async().await; let mock_server_url = s.url(); let client = Client::new(mock_server_url, "masterKey"); let path = "/tasks?indexUids=movies,test&statuses=equeued&types=documentDeletion&uids=1";