From 8dca36433c67c862b1b41ce68695d05a00f75dcb Mon Sep 17 00:00:00 2001 From: Kerollmops Date: Tue, 7 Sep 2021 10:37:57 +0200 Subject: [PATCH] Introduce the new SortRankingRuleMissing user error variant --- milli/src/error.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/milli/src/error.rs b/milli/src/error.rs index 9bda74631..56028f742 100644 --- a/milli/src/error.rs +++ b/milli/src/error.rs @@ -59,6 +59,7 @@ pub enum UserError { InvalidFilter(pest::error::Error), InvalidFilterAttribute(pest::error::Error), InvalidSortableAttribute { field: String, valid_fields: HashSet }, + SortRankingRuleMissing, InvalidStoreFile, MaxDatabaseSizeReached, MissingDocumentId { document: Object }, @@ -236,6 +237,10 @@ only composed of alphanumeric characters (a-z A-Z 0-9), hyphens (-) and undersco field, valid_names ) } + Self::SortRankingRuleMissing => f.write_str( + "The sort ranking rule must be specified in the \ + ranking rules settings to use the sort parameter at search time", + ), Self::MissingDocumentId { document } => { let json = serde_json::to_string(document).unwrap(); write!(f, "document doesn't have an identifier {}", json)