Skip to content

Commit 0620ccf

Browse files
bidoubiwabors[bot]
andcommitted
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>
1 parent 6317f9c commit 0620ccf

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

src/search.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,12 @@ pub struct SearchResult<T> {
4646
pub matches_position: Option<HashMap<String, Vec<MatchRange>>>,
4747
}
4848

49+
#[derive(Deserialize, Debug)]
50+
#[serde(rename_all = "camelCase")]
51+
pub struct FacetStats {
52+
pub min: u32,
53+
pub max: u32,
54+
}
4955
#[derive(Deserialize, Debug)]
5056
#[serde(rename_all = "camelCase")]
5157
/// A struct containing search results and other information about the search.
@@ -68,6 +74,8 @@ pub struct SearchResults<T> {
6874
pub total_pages: Option<usize>,
6975
/// Distribution of the given facets
7076
pub facet_distribution: Option<HashMap<String, HashMap<String, usize>>>,
77+
/// facet stats of the numerical facets requested in the `facet` search parameter.
78+
pub facet_stats: Option<HashMap<String, FacetStats>>,
7179
/// Processing time of the query
7280
pub processing_time_ms: usize,
7381
/// Query originating the response

src/tasks.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1057,7 +1057,6 @@ mod test {
10571057
#[meilisearch_test]
10581058
async fn test_delete_tasks_with_params() -> Result<(), Error> {
10591059
let mut s = mockito::Server::new_async().await;
1060-
// let mut s = mockito::Server::new_async().await;
10611060
let mock_server_url = s.url();
10621061
let client = Client::new(mock_server_url, Some("masterKey"));
10631062
let path = "/tasks?indexUids=movies,test&statuses=equeued&types=documentDeletion&uids=1";

0 commit comments

Comments
 (0)