feat: Introduce an Index system based on RocksDB

This commit is contained in:
Clément Renault 2018-11-15 17:55:20 +01:00
parent cc52d5dda5
commit b3249d515d
No known key found for this signature in database
GPG key ID: 0151CDAB43460DAE
14 changed files with 569 additions and 97 deletions

View file

@ -47,7 +47,7 @@ impl DocIds {
}
pub struct DocIdsBuilder<W> {
doc_ids: BTreeSet<DocumentId>,
doc_ids: BTreeSet<DocumentId>, // TODO: prefer a linked-list
wrt: W,
}
@ -59,8 +59,8 @@ impl<W: io::Write> DocIdsBuilder<W> {
}
}
pub fn insert(&mut self, doc: DocumentId) {
self.doc_ids.insert(doc);
pub fn insert(&mut self, doc: DocumentId) -> bool {
self.doc_ids.insert(doc)
}
pub fn into_inner(mut self) -> io::Result<W> {