From 7483614b75b8ea57e3960f5ac94c62a6acb7a8b8 Mon Sep 17 00:00:00 2001 From: Tamo Date: Tue, 31 Aug 2021 18:49:06 +0200 Subject: [PATCH] [HTTP-UI] add the sorters --- http-ui/src/main.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/http-ui/src/main.rs b/http-ui/src/main.rs index 108ec0549..89f3dcab2 100644 --- a/http-ui/src/main.rs +++ b/http-ui/src/main.rs @@ -695,6 +695,7 @@ async fn main() -> anyhow::Result<()> { struct QueryBody { query: Option, filters: Option, + sorters: Option, facet_filters: Option, String>>>, facet_distribution: Option, limit: Option, @@ -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();