From cc732fe95ef448454cf6eb98243aef75de80590e Mon Sep 17 00:00:00 2001 From: Tamo Date: Tue, 28 Sep 2021 11:15:24 +0200 Subject: [PATCH] update http-ui to use the sort-error --- http-ui/src/main.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/http-ui/src/main.rs b/http-ui/src/main.rs index 1bacdfbed..b76547309 100644 --- a/http-ui/src/main.rs +++ b/http-ui/src/main.rs @@ -22,7 +22,9 @@ use meilisearch_tokenizer::{Analyzer, AnalyzerConfig}; use milli::documents::DocumentBatchReader; use milli::update::UpdateIndexingStep::*; use milli::update::{IndexDocumentsMethod, Setting, UpdateBuilder}; -use milli::{obkv_to_json, CompressionType, FilterCondition, Index, MatchingWords, SearchResult}; +use milli::{ + obkv_to_json, CompressionType, FilterCondition, Index, MatchingWords, SearchResult, SortError, +}; use once_cell::sync::OnceCell; use rayon::ThreadPool; use serde::{Deserialize, Serialize}; @@ -756,7 +758,7 @@ async fn main() -> anyhow::Result<()> { } if let Some(sort) = query.sort { - search.sort_criteria(vec![sort.parse().unwrap()]); + search.sort_criteria(vec![sort.parse().map_err(SortError::from).unwrap()]); } let SearchResult { matching_words, candidates, documents_ids } =