Fix behavior when removing a document

This commit is contained in:
Louis Dureuil 2024-06-11 09:42:45 +02:00
parent 600e97d9dc
commit 7cef2299cf
No known key found for this signature in database
2 changed files with 8 additions and 0 deletions

View File

@ -64,6 +64,13 @@ impl<'t, 'i> ClearDocuments<'t, 'i> {
self.index.delete_geo_rtree(self.wtxn)?;
self.index.delete_geo_faceted_documents_ids(self.wtxn)?;
// Remove all user-provided bits from the configs
let mut configs = self.index.embedding_configs(self.wtxn)?;
for config in configs.iter_mut() {
config.user_provided.clear();
}
self.index.put_embedding_configs(self.wtxn, configs)?;
// Clear the other databases.
external_documents_ids.clear(self.wtxn)?;
word_docids.clear(self.wtxn)?;

View File

@ -225,6 +225,7 @@ pub fn extract_vector_points<R: io::Read + io::Seek>(
} else if document_is_kept && old.is_none() {
VectorStateDelta::NoChange
} else {
remove_from_user_provided.insert(docid);
VectorStateDelta::NowRemoved
}
}