mirror of
https://github.com/meilisearch/meilisearch.git
synced 2024-12-19 01:45:54 +08:00
make clippy happy
This commit is contained in:
parent
34254b42b6
commit
0c04cd1d9f
@ -355,4 +355,5 @@ pub fn search_kind(
|
|||||||
|
|
||||||
(_, None, Some(_)) => Err(MeilisearchHttpError::MissingSearchHybrid.into()),
|
(_, None, Some(_)) => Err(MeilisearchHttpError::MissingSearchHybrid.into()),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,25 +1,22 @@
|
|||||||
pub mod search_test {
|
use crate::routes::indexes::search::fix_sort_query_parameters;
|
||||||
use crate::routes::indexes::search::fix_sort_query_parameters;
|
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_fix_sort_query_parameters() {
|
fn test_fix_sort_query_parameters() {
|
||||||
let sort = fix_sort_query_parameters("_geoPoint(12, 13):asc");
|
let sort = fix_sort_query_parameters("_geoPoint(12, 13):asc");
|
||||||
assert_eq!(sort, vec!["_geoPoint(12,13):asc".to_string()]);
|
assert_eq!(sort, vec!["_geoPoint(12,13):asc".to_string()]);
|
||||||
let sort = fix_sort_query_parameters("doggo:asc,_geoPoint(12.45,13.56):desc");
|
let sort = fix_sort_query_parameters("doggo:asc,_geoPoint(12.45,13.56):desc");
|
||||||
assert_eq!(sort, vec!["doggo:asc".to_string(), "_geoPoint(12.45,13.56):desc".to_string(),]);
|
assert_eq!(sort, vec!["doggo:asc".to_string(), "_geoPoint(12.45,13.56):desc".to_string(),]);
|
||||||
let sort = fix_sort_query_parameters(
|
let sort =
|
||||||
"doggo:asc , _geoPoint(12.45, 13.56, 2590352):desc , catto:desc",
|
fix_sort_query_parameters("doggo:asc , _geoPoint(12.45, 13.56, 2590352):desc , catto:desc");
|
||||||
);
|
assert_eq!(
|
||||||
assert_eq!(
|
sort,
|
||||||
sort,
|
vec![
|
||||||
vec![
|
"doggo:asc".to_string(),
|
||||||
"doggo:asc".to_string(),
|
"_geoPoint(12.45,13.56,2590352):desc".to_string(),
|
||||||
"_geoPoint(12.45,13.56,2590352):desc".to_string(),
|
"catto:desc".to_string(),
|
||||||
"catto:desc".to_string(),
|
]
|
||||||
]
|
);
|
||||||
);
|
let sort = fix_sort_query_parameters("doggo:asc , _geoPoint(1, 2), catto:desc");
|
||||||
let sort = fix_sort_query_parameters("doggo:asc , _geoPoint(1, 2), catto:desc");
|
// This is ugly but eh, I don't want to write a full parser just for this unused route
|
||||||
// This is ugly but eh, I don't want to write a full parser just for this unused route
|
assert_eq!(sort, vec!["doggo:asc".to_string(), "_geoPoint(1,2),catto:desc".to_string(),]);
|
||||||
assert_eq!(sort, vec!["doggo:asc".to_string(), "_geoPoint(1,2),catto:desc".to_string(),]);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user