mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-04 12:27:13 +02:00
fix encoding bug
This commit is contained in:
parent
2716c1aebb
commit
99551fc21b
9 changed files with 34 additions and 41 deletions
|
@ -81,7 +81,7 @@ impl UpdateHandler {
|
|||
primary_key.as_deref(),
|
||||
),
|
||||
ClearDocuments => index.clear_documents(update_builder),
|
||||
DeleteDocuments => index.delete_documents(content, update_builder),
|
||||
DeleteDocuments { documents } => index.delete_documents(documents.to_vec(), update_builder),
|
||||
Settings(settings) => index.update_settings(&settings.clone().check(), update_builder),
|
||||
};
|
||||
|
||||
|
|
|
@ -298,18 +298,14 @@ impl Index {
|
|||
|
||||
pub fn delete_documents(
|
||||
&self,
|
||||
document_ids: Option<impl io::Read>,
|
||||
document_ids: Vec<String>,
|
||||
update_builder: UpdateBuilder,
|
||||
) -> anyhow::Result<UpdateResult> {
|
||||
let ids = match document_ids {
|
||||
Some(reader) => serde_json::from_reader(reader)?,
|
||||
None => Vec::<String>::new(),
|
||||
};
|
||||
let mut txn = self.write_txn()?;
|
||||
let mut builder = update_builder.delete_documents(&mut txn, self)?;
|
||||
|
||||
// We ignore unexisting document ids
|
||||
ids.iter().for_each(|id| {
|
||||
document_ids.iter().for_each(|id| {
|
||||
builder.delete_external_id(id);
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue