fix the tests and the arroy_readers method

This commit is contained in:
Tamo 2024-09-19 10:32:17 +02:00
parent cc45e264ca
commit 79f29eed3c
13 changed files with 39 additions and 40 deletions

View file

@ -1612,11 +1612,20 @@ impl Index {
pub fn arroy_readers<'a>(
&'a self,
rtxn: &'a RoTxn<'a>,
embedder_id: u8,
quantized: bool,
) -> impl Iterator<Item = ArroyReader> + 'a {
crate::vector::arroy_db_range_for_embedder(embedder_id)
.map_while(move |k| Some(ArroyReader::new(self.vector_arroy, k, quantized)))
) -> impl Iterator<Item = Result<ArroyReader>> + 'a {
crate::vector::arroy_db_range_for_embedder(embedder_id).map_while(move |k| {
let reader = ArroyReader::new(self.vector_arroy, k, quantized);
// Here we don't care about the dimensions, but we want to know if we can read
// in the database or if its medata are missing.
match reader.dimensions(rtxn) {
Ok(_) => Some(Ok(reader)),
Err(arroy::Error::MissingMetadata(_)) => None,
Err(e) => Some(Err(e.into())),
}
})
}
pub(crate) fn put_search_cutoff(&self, wtxn: &mut RwTxn<'_>, cutoff: u64) -> heed::Result<()> {