pub struct DiskAnnIndex { /* private fields */ }Expand description
DiskANN index with Vamana graph + optional PQ + mmap persistence
Implementations§
Source§impl DiskAnnIndex
impl DiskAnnIndex
Sourcepub fn new(config: DiskAnnConfig) -> Self
pub fn new(config: DiskAnnConfig) -> Self
Create a new DiskANN index
Sourcepub fn insert(&mut self, id: String, vector: Vec<f32>) -> Result<()>
pub fn insert(&mut self, id: String, vector: Vec<f32>) -> Result<()>
Insert a vector with a string ID
Sourcepub fn insert_batch(&mut self, entries: Vec<(String, Vec<f32>)>) -> Result<()>
pub fn insert_batch(&mut self, entries: Vec<(String, Vec<f32>)>) -> Result<()>
Insert a batch of vectors
Sourcepub fn build(&mut self) -> Result<()>
pub fn build(&mut self) -> Result<()>
Build the index (must be called after all inserts, before search)
Sourcepub fn search(&self, query: &[f32], k: usize) -> Result<Vec<SearchResult>>
pub fn search(&self, query: &[f32], k: usize) -> Result<Vec<SearchResult>>
Search for k nearest neighbors
Auto Trait Implementations§
impl Freeze for DiskAnnIndex
impl RefUnwindSafe for DiskAnnIndex
impl Send for DiskAnnIndex
impl Sync for DiskAnnIndex
impl Unpin for DiskAnnIndex
impl UnsafeUnpin for DiskAnnIndex
impl UnwindSafe for DiskAnnIndex
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more