Fix multiple bugs

This commit is contained in:
Kerollmops
2020-06-11 11:55:03 +02:00
parent 4e86ecf807
commit 0a83a86e65
6 changed files with 63 additions and 50 deletions

View File

@ -45,10 +45,10 @@ struct Opt {
struct Indexed {
fst: fst::Set<Vec<u8>>,
postings_attrs: FastMap4<SmallVec32, RoaringBitmap>,
prefix_postings_attrs: FastMap4<SmallVec32, RoaringBitmap>,
postings_ids: FastMap4<SmallVec32, FastMap4<AttributeId, RoaringBitmap>>,
prefix_postings_ids: FastMap4<SmallVec32, FastMap4<AttributeId, RoaringBitmap>>,
postings_attrs: FastMap4<SmallVec32<u8>, RoaringBitmap>,
prefix_postings_attrs: FastMap4<SmallVec32<u8>, RoaringBitmap>,
postings_ids: FastMap4<SmallVec32<u8>, FastMap4<AttributeId, RoaringBitmap>>,
prefix_postings_ids: FastMap4<SmallVec32<u8>, FastMap4<AttributeId, RoaringBitmap>>,
headers: Vec<u8>,
documents: Vec<(DocumentId, Vec<u8>)>,
}

View File

@ -93,9 +93,9 @@ async fn main() -> anyhow::Result<()> {
body.extend_from_slice(headers);
for id in documents_ids {
if let Some(content) = index.documents.get(&rtxn, &BEU32::new(id)).unwrap() {
body.extend_from_slice(&content);
}
let content = index.documents.get(&rtxn, &BEU32::new(id)).unwrap();
let content = content.expect(&format!("could not find document {}", id));
body.extend_from_slice(&content);
}
}