WIP: Comment out document deletion in other pipelines than update

TODO: fix calls to DELETE route
This commit is contained in:
Louis Dureuil 2023-10-24 17:04:02 +02:00
parent bafeb892a7
commit c6b3c18c85
No known key found for this signature in database
3 changed files with 13 additions and 17 deletions

View File

@ -255,12 +255,14 @@ impl<'t, 'u, 'i> DeleteDocuments<'t, 'u, 'i> {
}
// We acquire the current external documents ids map...
// 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
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.
let new_external_documents_ids = new_external_documents_ids.into_static();
self.index.put_external_documents_ids(self.wtxn, &new_external_documents_ids)?;
//let new_external_documents_ids = new_external_documents_ids.into_static();
//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_delete = BTreeSet::default();

View File

@ -457,10 +457,10 @@ where
self.index.put_primary_key(self.wtxn, &primary_key)?;
// We write the external documents ids into the main database.
let mut external_documents_ids = self.index.external_documents_ids(self.wtxn)?;
external_documents_ids.insert_ids(&new_external_documents_ids)?;
let external_documents_ids = external_documents_ids.into_static();
self.index.put_external_documents_ids(self.wtxn, &external_documents_ids)?;
//let mut external_documents_ids = self.index.external_documents_ids(self.wtxn)?;
//external_documents_ids.insert_ids(&new_external_documents_ids)?;
//let external_documents_ids = external_documents_ids.into_static();
//self.index.put_external_documents_ids(self.wtxn, &external_documents_ids)?;
// FIXME: remove `new_documents_ids` entirely and `replaced_documents_ids`
let all_documents_ids = index_documents_ids | new_documents_ids;

View File

@ -763,14 +763,6 @@ impl<'a, 'i> Transform<'a, 'i> {
.to_string();
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_count = documents_ids.len() as usize;
@ -858,8 +850,10 @@ impl<'a, 'i> Transform<'a, 'i> {
primary_key,
fields_ids_map: new_fields_ids_map,
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,
// FIXME: remove this now unused field
replaced_documents_ids: RoaringBitmap::default(),
documents_count,
original_documents: original_documents.into_inner().map_err(|err| err.into_error())?,