Introduce the Index path method

This commit is contained in:
Clément Renault 2020-10-30 11:46:00 +01:00
parent 085d3b9d94
commit 222063b19d
No known key found for this signature in database
GPG Key ID: 92ADA4E935E71FA4

View File

@ -59,6 +59,11 @@ impl Index {
self.env.read_txn() self.env.read_txn()
} }
/// Returns the canonicalized path where the heed `Env` of this `Index` lives.
pub fn path(&self) -> &Path {
self.env.path()
}
/// 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)