Fix tests

This commit is contained in:
ManyTheFish 2022-07-18 18:12:22 +02:00
parent 062d17fbc0
commit 0fa5c9b515
2 changed files with 10 additions and 6 deletions

View File

@ -1,5 +1,5 @@
pub use search::{ 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_HIGHLIGHT_POST_TAG, DEFAULT_HIGHLIGHT_PRE_TAG, DEFAULT_HIT_PER_PAGE, DEFAULT_PAGE,
DEFAULT_SEARCH_LIMIT, MatchingStrategy DEFAULT_SEARCH_LIMIT, MatchingStrategy
}; };

View File

@ -659,7 +659,7 @@ mod test {
use nelson::Mocker; use nelson::Mocker;
use crate::index::error::Result as IndexResult; use crate::index::error::Result as IndexResult;
use crate::index::Index; use crate::index::{HitsInfo, Index};
use crate::index::{ use crate::index::{
DEFAULT_CROP_MARKER, DEFAULT_HIGHLIGHT_POST_TAG, DEFAULT_HIGHLIGHT_PRE_TAG, DEFAULT_CROP_MARKER, DEFAULT_HIGHLIGHT_POST_TAG, DEFAULT_HIGHLIGHT_PRE_TAG,
}; };
@ -692,7 +692,9 @@ mod test {
let query = SearchQuery { let query = SearchQuery {
q: Some(String::from("hello world")), q: Some(String::from("hello world")),
offset: Some(10), 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_retrieve: Some(vec!["string".to_owned()].into_iter().collect()),
attributes_to_crop: None, attributes_to_crop: None,
crop_length: 18, crop_length: 18,
@ -709,10 +711,12 @@ mod test {
let result = SearchResult { let result = SearchResult {
hits: vec![], hits: vec![],
estimated_total_hits: 29,
query: "hello world".to_string(), query: "hello world".to_string(),
limit: 24, hits_info: HitsInfo::OffsetLimit {
offset: 0, limit: 24,
offset: 0,
estimated_total_hits: 29,
},
processing_time_ms: 50, processing_time_ms: 50,
facet_distribution: None, facet_distribution: None,
}; };