mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-04 20:37:15 +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
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue