chore(http, lib): rename typo to typo_tolerance

This commit is contained in:
ad hoc 2022-04-14 10:42:06 +02:00
parent f67167fa9f
commit 276dc6043a
No known key found for this signature in database
GPG Key ID: 4F00A782990CC643
3 changed files with 13 additions and 13 deletions

View File

@ -162,10 +162,10 @@ make_setting_route!(
); );
make_setting_route!( make_setting_route!(
"/typo", "/typo-tolerance",
meilisearch_lib::index::updates::TypoSettings, meilisearch_lib::index::updates::TypoSettings,
typo, typo_tolerance,
"typo" "typoTolerance"
); );
make_setting_route!( make_setting_route!(
@ -254,7 +254,7 @@ generate_configure!(
stop_words, stop_words,
synonyms, synonyms,
ranking_rules, ranking_rules,
typo typo_tolerance
); );
pub async fn update_all( pub async fn update_all(

View File

@ -213,7 +213,7 @@ impl Index {
None => Setting::Reset, None => Setting::Reset,
}, },
synonyms: Setting::Set(synonyms), synonyms: Setting::Set(synonyms),
typo: Setting::Set(typo_tolerance), typo_tolerance: Setting::Set(typo_tolerance),
_kind: PhantomData, _kind: PhantomData,
}) })
} }

View File

@ -113,7 +113,7 @@ pub struct Settings<T> {
pub distinct_attribute: Setting<String>, pub distinct_attribute: Setting<String>,
#[serde(default, skip_serializing_if = "Setting::is_not_set")] #[serde(default, skip_serializing_if = "Setting::is_not_set")]
#[cfg_attr(test, proptest(strategy = "test::setting_strategy()"))] #[cfg_attr(test, proptest(strategy = "test::setting_strategy()"))]
pub typo: Setting<TypoSettings>, pub typo_tolerance: Setting<TypoSettings>,
#[serde(skip)] #[serde(skip)]
pub _kind: PhantomData<T>, pub _kind: PhantomData<T>,
@ -130,7 +130,7 @@ impl Settings<Checked> {
stop_words: Setting::Reset, stop_words: Setting::Reset,
synonyms: Setting::Reset, synonyms: Setting::Reset,
distinct_attribute: Setting::Reset, distinct_attribute: Setting::Reset,
typo: Setting::Reset, typo_tolerance: Setting::Reset,
_kind: PhantomData, _kind: PhantomData,
} }
} }
@ -145,7 +145,7 @@ impl Settings<Checked> {
stop_words, stop_words,
synonyms, synonyms,
distinct_attribute, distinct_attribute,
typo: typo_tolerance, typo_tolerance,
.. ..
} = self; } = self;
@ -158,7 +158,7 @@ impl Settings<Checked> {
stop_words, stop_words,
synonyms, synonyms,
distinct_attribute, distinct_attribute,
typo: typo_tolerance, typo_tolerance,
_kind: PhantomData, _kind: PhantomData,
} }
} }
@ -197,7 +197,7 @@ impl Settings<Unchecked> {
stop_words: self.stop_words, stop_words: self.stop_words,
synonyms: self.synonyms, synonyms: self.synonyms,
distinct_attribute: self.distinct_attribute, distinct_attribute: self.distinct_attribute,
typo: self.typo, typo_tolerance: self.typo_tolerance,
_kind: PhantomData, _kind: PhantomData,
} }
} }
@ -373,7 +373,7 @@ pub fn apply_settings_to_builder(
Setting::NotSet => (), Setting::NotSet => (),
} }
match settings.typo { match settings.typo_tolerance {
Setting::Set(ref value) => { Setting::Set(ref value) => {
match value.enabled { match value.enabled {
Setting::Set(val) => builder.set_autorize_typos(val), Setting::Set(val) => builder.set_autorize_typos(val),
@ -455,7 +455,7 @@ pub(crate) mod test {
stop_words: Setting::NotSet, stop_words: Setting::NotSet,
synonyms: Setting::NotSet, synonyms: Setting::NotSet,
distinct_attribute: Setting::NotSet, distinct_attribute: Setting::NotSet,
typo: Setting::NotSet, typo_tolerance: Setting::NotSet,
_kind: PhantomData::<Unchecked>, _kind: PhantomData::<Unchecked>,
}; };
@ -477,7 +477,7 @@ pub(crate) mod test {
stop_words: Setting::NotSet, stop_words: Setting::NotSet,
synonyms: Setting::NotSet, synonyms: Setting::NotSet,
distinct_attribute: Setting::NotSet, distinct_attribute: Setting::NotSet,
typo: Setting::NotSet, typo_tolerance: Setting::NotSet,
_kind: PhantomData::<Unchecked>, _kind: PhantomData::<Unchecked>,
}; };