mirror of
https://github.com/meilisearch/MeiliSearch
synced 2024-11-22 21:04:27 +01:00
WIP: Comment out document deletion in other pipelines than update
TODO: fix calls to DELETE route
This commit is contained in:
parent
bafeb892a7
commit
c6b3c18c85
@ -255,12 +255,14 @@ impl<'t, 'u, 'i> DeleteDocuments<'t, 'u, 'i> {
|
|||||||
}
|
}
|
||||||
// We acquire the current external documents ids map...
|
// We acquire the current external documents ids map...
|
||||||
// Note that its soft-deleted document ids field will be equal to the `to_delete_docids`
|
// Note that its soft-deleted document ids field will be equal to the `to_delete_docids`
|
||||||
let mut new_external_documents_ids = self.index.external_documents_ids(self.wtxn)?;
|
//let mut new_external_documents_ids = self.index.external_documents_ids(self.wtxn)?;
|
||||||
// We then remove the soft-deleted docids from it
|
// We then remove the soft-deleted docids from it
|
||||||
new_external_documents_ids.delete_soft_deleted_documents_ids_from_fsts()?;
|
//new_external_documents_ids.delete_soft_deleted_documents_ids_from_fsts()?;
|
||||||
// and write it back to the main database.
|
// and write it back to the main database.
|
||||||
let new_external_documents_ids = new_external_documents_ids.into_static();
|
//let new_external_documents_ids = new_external_documents_ids.into_static();
|
||||||
self.index.put_external_documents_ids(self.wtxn, &new_external_documents_ids)?;
|
//self.index.put_external_documents_ids(self.wtxn, &new_external_documents_ids)?;
|
||||||
|
|
||||||
|
todo!("please autobatch deletions for now");
|
||||||
|
|
||||||
let mut words_to_keep = BTreeSet::default();
|
let mut words_to_keep = BTreeSet::default();
|
||||||
let mut words_to_delete = BTreeSet::default();
|
let mut words_to_delete = BTreeSet::default();
|
||||||
|
@ -457,10 +457,10 @@ where
|
|||||||
self.index.put_primary_key(self.wtxn, &primary_key)?;
|
self.index.put_primary_key(self.wtxn, &primary_key)?;
|
||||||
|
|
||||||
// We write the external documents ids into the main database.
|
// We write the external documents ids into the main database.
|
||||||
let mut external_documents_ids = self.index.external_documents_ids(self.wtxn)?;
|
//let mut external_documents_ids = self.index.external_documents_ids(self.wtxn)?;
|
||||||
external_documents_ids.insert_ids(&new_external_documents_ids)?;
|
//external_documents_ids.insert_ids(&new_external_documents_ids)?;
|
||||||
let external_documents_ids = external_documents_ids.into_static();
|
//let external_documents_ids = external_documents_ids.into_static();
|
||||||
self.index.put_external_documents_ids(self.wtxn, &external_documents_ids)?;
|
//self.index.put_external_documents_ids(self.wtxn, &external_documents_ids)?;
|
||||||
|
|
||||||
// FIXME: remove `new_documents_ids` entirely and `replaced_documents_ids`
|
// FIXME: remove `new_documents_ids` entirely and `replaced_documents_ids`
|
||||||
let all_documents_ids = index_documents_ids | new_documents_ids;
|
let all_documents_ids = index_documents_ids | new_documents_ids;
|
||||||
|
@ -763,14 +763,6 @@ impl<'a, 'i> Transform<'a, 'i> {
|
|||||||
.to_string();
|
.to_string();
|
||||||
let field_distribution = self.index.field_distribution(wtxn)?;
|
let field_distribution = self.index.field_distribution(wtxn)?;
|
||||||
|
|
||||||
// Delete the soft deleted document ids from the maps inside the external_document_ids structure
|
|
||||||
let new_external_documents_ids = {
|
|
||||||
let mut external_documents_ids = self.index.external_documents_ids(wtxn)?;
|
|
||||||
external_documents_ids.delete_soft_deleted_documents_ids_from_fsts()?;
|
|
||||||
// This call should be free and can't fail since the previous method merged both fsts.
|
|
||||||
external_documents_ids.into_static().to_fst()?.into_owned()
|
|
||||||
};
|
|
||||||
|
|
||||||
let documents_ids = self.index.documents_ids(wtxn)?;
|
let documents_ids = self.index.documents_ids(wtxn)?;
|
||||||
let documents_count = documents_ids.len() as usize;
|
let documents_count = documents_ids.len() as usize;
|
||||||
|
|
||||||
@ -858,8 +850,10 @@ impl<'a, 'i> Transform<'a, 'i> {
|
|||||||
primary_key,
|
primary_key,
|
||||||
fields_ids_map: new_fields_ids_map,
|
fields_ids_map: new_fields_ids_map,
|
||||||
field_distribution,
|
field_distribution,
|
||||||
new_external_documents_ids,
|
// FIXME: remove this now unused field
|
||||||
|
new_external_documents_ids: fst::Map::default().map_data(Cow::Owned).unwrap(),
|
||||||
new_documents_ids: documents_ids,
|
new_documents_ids: documents_ids,
|
||||||
|
// FIXME: remove this now unused field
|
||||||
replaced_documents_ids: RoaringBitmap::default(),
|
replaced_documents_ids: RoaringBitmap::default(),
|
||||||
documents_count,
|
documents_count,
|
||||||
original_documents: original_documents.into_inner().map_err(|err| err.into_error())?,
|
original_documents: original_documents.into_inner().map_err(|err| err.into_error())?,
|
||||||
|
Loading…
Reference in New Issue
Block a user