mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-04 04:17:10 +02:00
replace index_new_fields to accept_new_fields; fix #475
This commit is contained in:
parent
1df51c52e0
commit
a067a1b16b
5 changed files with 27 additions and 27 deletions
|
@ -26,7 +26,7 @@ pub struct Settings {
|
|||
#[serde(default, deserialize_with = "deserialize_some")]
|
||||
pub synonyms: Option<Option<BTreeMap<String, Vec<String>>>>,
|
||||
#[serde(default, deserialize_with = "deserialize_some")]
|
||||
pub index_new_fields: Option<Option<bool>>,
|
||||
pub accept_new_fields: Option<Option<bool>>,
|
||||
}
|
||||
|
||||
// Any value that is present is considered Some value, including null.
|
||||
|
@ -55,7 +55,7 @@ impl Settings {
|
|||
displayed_attributes: settings.displayed_attributes.into(),
|
||||
stop_words: settings.stop_words.into(),
|
||||
synonyms: settings.synonyms.into(),
|
||||
index_new_fields: settings.index_new_fields.into(),
|
||||
accept_new_fields: settings.accept_new_fields.into(),
|
||||
})
|
||||
}
|
||||
}
|
||||
|
@ -161,7 +161,7 @@ pub struct SettingsUpdate {
|
|||
pub displayed_attributes: UpdateState<HashSet<String>>,
|
||||
pub stop_words: UpdateState<BTreeSet<String>>,
|
||||
pub synonyms: UpdateState<BTreeMap<String, Vec<String>>>,
|
||||
pub index_new_fields: UpdateState<bool>,
|
||||
pub accept_new_fields: UpdateState<bool>,
|
||||
}
|
||||
|
||||
impl Default for SettingsUpdate {
|
||||
|
@ -174,7 +174,7 @@ impl Default for SettingsUpdate {
|
|||
displayed_attributes: UpdateState::Nothing,
|
||||
stop_words: UpdateState::Nothing,
|
||||
synonyms: UpdateState::Nothing,
|
||||
index_new_fields: UpdateState::Nothing,
|
||||
accept_new_fields: UpdateState::Nothing,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -68,12 +68,12 @@ pub fn apply_settings_update(
|
|||
UpdateState::Nothing => (),
|
||||
}
|
||||
|
||||
match settings.index_new_fields {
|
||||
match settings.accept_new_fields {
|
||||
UpdateState::Update(v) => {
|
||||
schema.set_index_new_fields(v);
|
||||
schema.set_accept_new_fields(v);
|
||||
},
|
||||
UpdateState::Clear => {
|
||||
schema.set_index_new_fields(true);
|
||||
schema.set_accept_new_fields(true);
|
||||
},
|
||||
UpdateState::Nothing => (),
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue