From 0fa5c9b51592d16578c212ef02c4268398567112 Mon Sep 17 00:00:00 2001 From: ManyTheFish Date: Mon, 18 Jul 2022 18:12:22 +0200 Subject: [PATCH] Fix tests --- meilisearch-lib/src/index/mod.rs | 2 +- meilisearch-lib/src/index_controller/mod.rs | 14 +++++++++----- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/meilisearch-lib/src/index/mod.rs b/meilisearch-lib/src/index/mod.rs index 283e44294..08f1f42d5 100644 --- a/meilisearch-lib/src/index/mod.rs +++ b/meilisearch-lib/src/index/mod.rs @@ -1,5 +1,5 @@ pub use search::{ - SearchQuery, SearchResult, DEFAULT_CROP_LENGTH, DEFAULT_CROP_MARKER, + HitsInfo, SearchQuery, SearchResult, DEFAULT_CROP_LENGTH, DEFAULT_CROP_MARKER, DEFAULT_HIGHLIGHT_POST_TAG, DEFAULT_HIGHLIGHT_PRE_TAG, DEFAULT_HIT_PER_PAGE, DEFAULT_PAGE, DEFAULT_SEARCH_LIMIT, MatchingStrategy }; diff --git a/meilisearch-lib/src/index_controller/mod.rs b/meilisearch-lib/src/index_controller/mod.rs index be855300b..b5a1daef6 100644 --- a/meilisearch-lib/src/index_controller/mod.rs +++ b/meilisearch-lib/src/index_controller/mod.rs @@ -659,7 +659,7 @@ mod test { use nelson::Mocker; use crate::index::error::Result as IndexResult; - use crate::index::Index; + use crate::index::{HitsInfo, Index}; use crate::index::{ DEFAULT_CROP_MARKER, DEFAULT_HIGHLIGHT_POST_TAG, DEFAULT_HIGHLIGHT_PRE_TAG, }; @@ -692,7 +692,9 @@ mod test { let query = SearchQuery { q: Some(String::from("hello world")), offset: Some(10), - limit: 0, + limit: Some(0), + page: 1, + hits_per_page: 10, attributes_to_retrieve: Some(vec!["string".to_owned()].into_iter().collect()), attributes_to_crop: None, crop_length: 18, @@ -709,10 +711,12 @@ mod test { let result = SearchResult { hits: vec![], - estimated_total_hits: 29, query: "hello world".to_string(), - limit: 24, - offset: 0, + hits_info: HitsInfo::OffsetLimit { + limit: 24, + offset: 0, + estimated_total_hits: 29, + }, processing_time_ms: 50, facet_distribution: None, };