Skip to content

Commit 55efe83

Browse files
committed
vector-store: implement count for diskann
1 parent f246cbe commit 55efe83

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

crates/vector-store/src/vs_index/diskann.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ use crate::table::PrimaryId;
1919
use crate::table::Table;
2020
use crate::table::TableSearch;
2121
use crate::vs_index::actor::AnnR;
22+
use crate::vs_index::actor::CountR;
2223
use crate::vs_index::actor::VsIndex;
2324
use crate::vs_index::factory::VsIndexConfiguration;
2425
use crate::vs_index::validator;
@@ -164,8 +165,7 @@ fn new(
164165
)));
165166
}
166167
VsIndex::Count { tx, .. } => {
167-
_ = tx
168-
.send(Err(anyhow::anyhow!("DiskANN index is not implemented yet")));
168+
_ = tx.send(state.count());
169169
}
170170
}
171171
}
@@ -338,6 +338,10 @@ impl<T: TableSearch + Send + Sync + 'static> State<T> {
338338
)?;
339339
Ok((primary_keys, distances))
340340
}
341+
342+
fn count(&self) -> CountR {
343+
Ok(self.epoch_map.len())
344+
}
341345
}
342346

343347
#[hotpath::measure]

0 commit comments

Comments
 (0)