mirror of
https://github.com/meilisearch/meilisearch.git
synced 2024-11-23 02:27:40 +08:00
Implement iter method on ExternalDocumentsIds
This commit is contained in:
parent
5b20e625f3
commit
bf0651f23c
@ -18,7 +18,7 @@ pub struct DocumentOperation {
|
|||||||
pub kind: DocumentOperationKind,
|
pub kind: DocumentOperationKind,
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct ExternalDocumentsIds(pub Database<Str, OwnedType<BEU32>>);
|
pub struct ExternalDocumentsIds(Database<Str, OwnedType<BEU32>>);
|
||||||
|
|
||||||
impl ExternalDocumentsIds {
|
impl ExternalDocumentsIds {
|
||||||
pub fn new(db: Database<Str, OwnedType<BEU32>>) -> ExternalDocumentsIds {
|
pub fn new(db: Database<Str, OwnedType<BEU32>>) -> ExternalDocumentsIds {
|
||||||
@ -86,6 +86,11 @@ impl ExternalDocumentsIds {
|
|||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Returns an iterator over all the external ids.
|
||||||
|
pub fn iter<'t>(&self, rtxn: &'t RoTxn) -> heed::Result<RoIter<'t, Str, OwnedType<BEU32>>> {
|
||||||
|
self.0.iter(rtxn)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// An iterator over mappings between requested internal ids and external ids.
|
/// An iterator over mappings between requested internal ids and external ids.
|
||||||
|
@ -799,7 +799,7 @@ impl<'a, 'i> Transform<'a, 'i> {
|
|||||||
let mut obkv_buffer = Vec::new();
|
let mut obkv_buffer = Vec::new();
|
||||||
let mut document_sorter_key_buffer = Vec::new();
|
let mut document_sorter_key_buffer = Vec::new();
|
||||||
let mut document_sorter_value_buffer = Vec::new();
|
let mut document_sorter_value_buffer = Vec::new();
|
||||||
for result in self.index.external_documents_ids().0.iter(wtxn)? {
|
for result in self.index.external_documents_ids().iter(wtxn)? {
|
||||||
let (external_id, docid) = result?;
|
let (external_id, docid) = result?;
|
||||||
let obkv = self.index.documents.get(wtxn, &docid)?.ok_or(
|
let obkv = self.index.documents.get(wtxn, &docid)?.ok_or(
|
||||||
InternalError::DatabaseMissingEntry { db_name: db_name::DOCUMENTS, key: None },
|
InternalError::DatabaseMissingEntry { db_name: db_name::DOCUMENTS, key: None },
|
||||||
|
Loading…
Reference in New Issue
Block a user