From bb5d931f160ac355e44b084d2ffc1f0b2a559edb Mon Sep 17 00:00:00 2001 From: qdequele Date: Wed, 26 Feb 2020 18:32:15 +0100 Subject: [PATCH] rename criterions on settings route; fix #480 --- meilisearch-core/src/settings.rs | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/meilisearch-core/src/settings.rs b/meilisearch-core/src/settings.rs index 1bebdce53..0a9cdbb57 100644 --- a/meilisearch-core/src/settings.rs +++ b/meilisearch-core/src/settings.rs @@ -105,12 +105,12 @@ pub enum RankingRule { impl std::fmt::Display for RankingRule { fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { match self { - RankingRule::Typo => write!(f, "_typo"), - RankingRule::Words => write!(f, "_words"), - RankingRule::Proximity => write!(f, "_proximity"), - RankingRule::Attribute => write!(f, "_attribute"), - RankingRule::WordsPosition => write!(f, "_words_position"), - RankingRule::Exactness => write!(f, "_exactness"), + RankingRule::Typo => write!(f, "typo"), + RankingRule::Words => write!(f, "words"), + RankingRule::Proximity => write!(f, "proximity"), + RankingRule::Attribute => write!(f, "attribute"), + RankingRule::WordsPosition => write!(f, "words_position"), + RankingRule::Exactness => write!(f, "exactness"), RankingRule::Asc(field) => write!(f, "asc({})", field), RankingRule::Dsc(field) => write!(f, "dsc({})", field), } @@ -122,12 +122,12 @@ impl FromStr for RankingRule { fn from_str(s: &str) -> Result { let rule = match s { - "_typo" => RankingRule::Typo, - "_words" => RankingRule::Words, - "_proximity" => RankingRule::Proximity, - "_attribute" => RankingRule::Attribute, - "_words_position" => RankingRule::WordsPosition, - "_exactness" => RankingRule::Exactness, + "typo" => RankingRule::Typo, + "words" => RankingRule::Words, + "proximity" => RankingRule::Proximity, + "attribute" => RankingRule::Attribute, + "words_position" => RankingRule::WordsPosition, + "exactness" => RankingRule::Exactness, _ => { let captures = RANKING_RULE_REGEX.captures(s).ok_or(RankingRuleConversionError)?; match (captures.get(1).map(|m| m.as_str()), captures.get(2)) {