diff --git a/meilisearch-http/src/routes/indexes/settings.rs b/meilisearch-http/src/routes/indexes/settings.rs index 601f0d833..5cca8e68f 100644 --- a/meilisearch-http/src/routes/indexes/settings.rs +++ b/meilisearch-http/src/routes/indexes/settings.rs @@ -162,10 +162,10 @@ make_setting_route!( ); make_setting_route!( - "/typo", + "/typo-tolerance", meilisearch_lib::index::updates::TypoSettings, - typo, - "typo" + typo_tolerance, + "typoTolerance" ); make_setting_route!( @@ -254,7 +254,7 @@ generate_configure!( stop_words, synonyms, ranking_rules, - typo + typo_tolerance ); pub async fn update_all( diff --git a/meilisearch-lib/src/index/index.rs b/meilisearch-lib/src/index/index.rs index 81dedbeba..25727236a 100644 --- a/meilisearch-lib/src/index/index.rs +++ b/meilisearch-lib/src/index/index.rs @@ -213,7 +213,7 @@ impl Index { None => Setting::Reset, }, synonyms: Setting::Set(synonyms), - typo: Setting::Set(typo_tolerance), + typo_tolerance: Setting::Set(typo_tolerance), _kind: PhantomData, }) } diff --git a/meilisearch-lib/src/index/updates.rs b/meilisearch-lib/src/index/updates.rs index 0019c226a..265f80762 100644 --- a/meilisearch-lib/src/index/updates.rs +++ b/meilisearch-lib/src/index/updates.rs @@ -113,7 +113,7 @@ pub struct Settings { pub distinct_attribute: Setting, #[serde(default, skip_serializing_if = "Setting::is_not_set")] #[cfg_attr(test, proptest(strategy = "test::setting_strategy()"))] - pub typo: Setting, + pub typo_tolerance: Setting, #[serde(skip)] pub _kind: PhantomData, @@ -130,7 +130,7 @@ impl Settings { stop_words: Setting::Reset, synonyms: Setting::Reset, distinct_attribute: Setting::Reset, - typo: Setting::Reset, + typo_tolerance: Setting::Reset, _kind: PhantomData, } } @@ -145,7 +145,7 @@ impl Settings { stop_words, synonyms, distinct_attribute, - typo: typo_tolerance, + typo_tolerance, .. } = self; @@ -158,7 +158,7 @@ impl Settings { stop_words, synonyms, distinct_attribute, - typo: typo_tolerance, + typo_tolerance, _kind: PhantomData, } } @@ -197,7 +197,7 @@ impl Settings { stop_words: self.stop_words, synonyms: self.synonyms, distinct_attribute: self.distinct_attribute, - typo: self.typo, + typo_tolerance: self.typo_tolerance, _kind: PhantomData, } } @@ -373,7 +373,7 @@ pub fn apply_settings_to_builder( Setting::NotSet => (), } - match settings.typo { + match settings.typo_tolerance { Setting::Set(ref value) => { match value.enabled { Setting::Set(val) => builder.set_autorize_typos(val), @@ -455,7 +455,7 @@ pub(crate) mod test { stop_words: Setting::NotSet, synonyms: Setting::NotSet, distinct_attribute: Setting::NotSet, - typo: Setting::NotSet, + typo_tolerance: Setting::NotSet, _kind: PhantomData::, }; @@ -477,7 +477,7 @@ pub(crate) mod test { stop_words: Setting::NotSet, synonyms: Setting::NotSet, distinct_attribute: Setting::NotSet, - typo: Setting::NotSet, + typo_tolerance: Setting::NotSet, _kind: PhantomData::, };