Merge pull request #88 from meilisearch/heed-error-word-documents-count

Return an heed error from the word_documents_count method
This commit is contained in:
Clément Renault 2021-02-18 15:05:00 +01:00 committed by GitHub
commit e62157e896
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -356,11 +356,8 @@ impl Index {
/// Returns the number of documents ids associated with the given word, /// Returns the number of documents ids associated with the given word,
/// it is much faster than deserializing the bitmap and getting the length of it. /// it is much faster than deserializing the bitmap and getting the length of it.
pub fn word_documents_count(&self, rtxn: &RoTxn, word: &str) -> anyhow::Result<Option<u64>> { pub fn word_documents_count(&self, rtxn: &RoTxn, word: &str) -> heed::Result<Option<u64>> {
self.word_docids self.word_docids.remap_data_type::<RoaringBitmapLenCodec>().get(rtxn, word)
.remap_data_type::<RoaringBitmapLenCodec>()
.get(rtxn, word)
.map_err(Into::into)
} }
/* documents */ /* documents */