mirror of
https://github.com/meilisearch/meilisearch.git
synced 2024-11-27 04:25:06 +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 {
|
||||
query: Option<String>,
|
||||
filters: Option<String>,
|
||||
sorters: Option<String>,
|
||||
facet_filters: Option<Vec<UntaggedEither<Vec<String>, String>>>,
|
||||
facet_distribution: Option<bool>,
|
||||
limit: Option<usize>,
|
||||
@ -754,6 +755,10 @@ async fn main() -> anyhow::Result<()> {
|
||||
search.limit(limit);
|
||||
}
|
||||
|
||||
if let Some(sort) = query.sorters {
|
||||
search.sort_criteria(vec![sort.parse().unwrap()]);
|
||||
}
|
||||
|
||||
let SearchResult { matching_words, candidates, documents_ids } =
|
||||
search.execute().unwrap();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user