mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-04 20:37:15 +02:00
implement delete single document
This commit is contained in:
parent
c317af58bc
commit
28b9c158b1
4 changed files with 22 additions and 15 deletions
|
@ -187,7 +187,7 @@ impl UpdateHandler {
|
|||
let mut txn = self.index.write_txn()?;
|
||||
let mut builder = update_builder.delete_documents(&mut txn, &self.index)?;
|
||||
|
||||
// we ignore unexisting document ids
|
||||
// We ignore unexisting document ids
|
||||
ids.iter().for_each(|id| { builder.delete_external_id(id); });
|
||||
|
||||
match builder.execute() {
|
||||
|
@ -215,7 +215,7 @@ impl HandleUpdate<UpdateMeta, UpdateResult, String> for UpdateHandler {
|
|||
let result = match meta.meta() {
|
||||
DocumentsAddition { method, format } => self.update_documents(*format, *method, content, update_builder),
|
||||
ClearDocuments => self.clear_documents(update_builder),
|
||||
DeleteDocuments => self.delete_documents(content, update_builder,),
|
||||
DeleteDocuments => self.delete_documents(content, update_builder),
|
||||
Settings(settings) => self.update_settings(settings, update_builder),
|
||||
Facets(levels) => self.update_facets(levels, update_builder),
|
||||
};
|
||||
|
|
|
@ -133,7 +133,7 @@ pub trait IndexController {
|
|||
/// Clear all documents in the given index.
|
||||
fn clear_documents(&self, index: impl AsRef<str>) -> anyhow::Result<UpdateStatus>;
|
||||
|
||||
/// Clear all documents in the given index.
|
||||
/// Delete all documents in `document_ids`.
|
||||
fn delete_documents(&self, index: impl AsRef<str>, document_ids: Vec<String>) -> anyhow::Result<UpdateStatus>;
|
||||
|
||||
/// Updates an index settings. If the index does not exist, it will be created when the update
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue