Move the documents into another file

This commit is contained in:
Clément Renault
2020-08-07 13:11:31 +02:00
parent fae694a102
commit 91282c8b6a
4 changed files with 71 additions and 43 deletions

View File

@ -16,7 +16,6 @@ use heed::{PolyDatabase, Database};
use levenshtein_automata::LevenshteinAutomatonBuilder as LevBuilder;
use log::debug;
use once_cell::sync::Lazy;
use oxidized_mtbl::Reader;
use roaring::RoaringBitmap;
use self::best_proximity::BestProximity;
@ -72,13 +71,6 @@ impl Index {
self.main.get::<_, Str, ByteSlice>(rtxn, "headers")
}
pub fn documents<'t>(&self, rtxn: &'t heed::RoTxn) -> anyhow::Result<Option<Reader<&'t [u8]>>> {
match self.main.get::<_, Str, ByteSlice>(rtxn, "documents")? {
Some(bytes) => Ok(Some(Reader::new(bytes)?)),
None => Ok(None),
}
}
pub fn number_of_attributes<'t>(&self, rtxn: &'t heed::RoTxn) -> anyhow::Result<Option<usize>> {
match self.headers(rtxn)? {
Some(headers) => {