Introduce a clear all documents update

This commit is contained in:
Clément Renault 2019-10-23 16:32:11 +02:00
parent 8d9d183ce6
commit 047eba3ff3
No known key found for this signature in database
GPG key ID: 92ADA4E935E71FA4
7 changed files with 72 additions and 0 deletions

View file

@ -26,6 +26,10 @@ impl DocsWords {
self.docs_words.delete(writer, &document_id)
}
pub fn clear(self, writer: &mut heed::RwTxn) -> ZResult<()> {
self.docs_words.clear(writer)
}
pub fn doc_words(
self,
reader: &heed::RoTxn,

View file

@ -32,6 +32,10 @@ impl DocumentsFields {
self.documents_fields.delete_range(writer, start..=end)
}
pub fn clear(self, writer: &mut heed::RwTxn) -> ZResult<()> {
self.documents_fields.clear(writer)
}
pub fn document_attribute<'txn>(
self,
reader: &'txn heed::RoTxn,

View file

@ -32,6 +32,10 @@ impl DocumentsFieldsCounts {
.delete_range(writer, start..=end)
}
pub fn clear(self, writer: &mut heed::RwTxn) -> ZResult<()> {
self.documents_fields_counts.clear(writer)
}
pub fn document_field_count(
self,
reader: &heed::RoTxn,

View file

@ -166,6 +166,10 @@ impl Index {
)
}
pub fn clear_all(&self, writer: &mut heed::RwTxn) -> MResult<u64> {
update::push_clear_all(writer, self.updates, self.updates_results)
}
pub fn synonyms_addition(&self) -> update::SynonymsAddition {
update::SynonymsAddition::new(
self.updates,