mirror of
https://github.com/meilisearch/meilisearch.git
synced 2024-11-27 12:35:05 +08:00
[HTTP-UI] add the sorters
This commit is contained in:
parent
4820ac71a6
commit
7483614b75
@ -695,6 +695,7 @@ async fn main() -> anyhow::Result<()> {
|
|||||||
struct QueryBody {
|
struct QueryBody {
|
||||||
query: Option<String>,
|
query: Option<String>,
|
||||||
filters: Option<String>,
|
filters: Option<String>,
|
||||||
|
sorters: Option<String>,
|
||||||
facet_filters: Option<Vec<UntaggedEither<Vec<String>, String>>>,
|
facet_filters: Option<Vec<UntaggedEither<Vec<String>, String>>>,
|
||||||
facet_distribution: Option<bool>,
|
facet_distribution: Option<bool>,
|
||||||
limit: Option<usize>,
|
limit: Option<usize>,
|
||||||
@ -754,6 +755,10 @@ async fn main() -> anyhow::Result<()> {
|
|||||||
search.limit(limit);
|
search.limit(limit);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if let Some(sort) = query.sorters {
|
||||||
|
search.sort_criteria(vec![sort.parse().unwrap()]);
|
||||||
|
}
|
||||||
|
|
||||||
let SearchResult { matching_words, candidates, documents_ids } =
|
let SearchResult { matching_words, candidates, documents_ids } =
|
||||||
search.execute().unwrap();
|
search.execute().unwrap();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user