mirror of
https://github.com/meilisearch/MeiliSearch
synced 2024-11-27 07:14:26 +01:00
Introduce the prepare_for_closing Index method
This commit is contained in:
parent
222063b19d
commit
99da69c85f
@ -64,6 +64,15 @@ impl Index {
|
|||||||
self.env.path()
|
self.env.path()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Returns an `EnvClosingEvent` that can be used to wait for the closing event,
|
||||||
|
/// multiple threads can wait on this event.
|
||||||
|
///
|
||||||
|
/// Make sure that you drop all the copies of `Index`es you have, env closing are triggered
|
||||||
|
/// when all references are dropped, the last one will eventually close the environment.
|
||||||
|
pub fn prepare_for_closing(self) -> heed::EnvClosingEvent {
|
||||||
|
self.env.prepare_for_closing()
|
||||||
|
}
|
||||||
|
|
||||||
/// Writes the documents ids that corresponds to the user-ids-documents-ids FST.
|
/// Writes the documents ids that corresponds to the user-ids-documents-ids FST.
|
||||||
pub fn put_documents_ids(&self, wtxn: &mut heed::RwTxn, docids: &RoaringBitmap) -> heed::Result<()> {
|
pub fn put_documents_ids(&self, wtxn: &mut heed::RwTxn, docids: &RoaringBitmap) -> heed::Result<()> {
|
||||||
self.main.put::<_, Str, RoaringBitmapCodec>(wtxn, DOCUMENTS_IDS_KEY, docids)
|
self.main.put::<_, Str, RoaringBitmapCodec>(wtxn, DOCUMENTS_IDS_KEY, docids)
|
||||||
|
Loading…
Reference in New Issue
Block a user