mirror of
https://github.com/meilisearch/meilisearch.git
synced 2025-07-27 00:31:02 +00:00
replace index_new_fields to accept_new_fields; fix #475
This commit is contained in:
@ -13,7 +13,7 @@ pub struct Schema {
|
||||
indexed: Vec<FieldId>,
|
||||
indexed_map: HashMap<FieldId, IndexedPos>,
|
||||
|
||||
index_new_fields: bool,
|
||||
accept_new_fields: bool,
|
||||
}
|
||||
|
||||
impl Schema {
|
||||
@ -28,7 +28,7 @@ impl Schema {
|
||||
displayed: HashSet::new(),
|
||||
indexed: Vec::new(),
|
||||
indexed_map: HashMap::new(),
|
||||
index_new_fields: true,
|
||||
accept_new_fields: true,
|
||||
}
|
||||
}
|
||||
|
||||
@ -68,7 +68,7 @@ impl Schema {
|
||||
Ok(id)
|
||||
}
|
||||
None => {
|
||||
if self.index_new_fields {
|
||||
if self.accept_new_fields {
|
||||
self.set_indexed(name)?;
|
||||
self.set_displayed(name)
|
||||
} else {
|
||||
@ -190,11 +190,11 @@ impl Schema {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn index_new_fields(&self) -> bool {
|
||||
self.index_new_fields
|
||||
pub fn accept_new_fields(&self) -> bool {
|
||||
self.accept_new_fields
|
||||
}
|
||||
|
||||
pub fn set_index_new_fields(&mut self, value: bool) {
|
||||
self.index_new_fields = value;
|
||||
pub fn set_accept_new_fields(&mut self, value: bool) {
|
||||
self.accept_new_fields = value;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user