530: fix the searchable fields bug when a field is nested r=Kerollmops a=irevoire

port #528 to main

Co-authored-by: Tamo <tamo@meilisearch.com>
This commit is contained in:
bors[bot]
2022-05-16 15:52:30 +00:00
committed by GitHub
3 changed files with 176 additions and 7 deletions

View File

@ -343,11 +343,15 @@ impl<'a, 't, 'u, 'i> Settings<'a, 't, 'u, 'i> {
new_fields_ids_map.insert(&name).ok_or(UserError::AttributeLimitReached)?;
}
self.index.put_searchable_fields(self.wtxn, &names)?;
self.index.put_all_searchable_fields_from_fields_ids_map(
self.wtxn,
&names,
&new_fields_ids_map,
)?;
self.index.put_fields_ids_map(self.wtxn, &new_fields_ids_map)?;
}
Setting::Reset => {
self.index.delete_searchable_fields(self.wtxn)?;
self.index.delete_all_searchable_fields(self.wtxn)?;
}
Setting::NotSet => return Ok(false),
}