pub struct TurboQuantIndex { /* private fields */ }Expand description
TurboQuant index for fast approximate nearest neighbor search
Implementations§
Source§impl TurboQuantIndex
impl TurboQuantIndex
Sourcepub fn new(config: TurboQuantConfig) -> Result<Self>
pub fn new(config: TurboQuantConfig) -> Result<Self>
Create a new TurboQuant index
Sourcepub fn add_vector(&mut self, entity_id: i64, vector: &[f32]) -> Result<()>
pub fn add_vector(&mut self, entity_id: i64, vector: &[f32]) -> Result<()>
Add a vector to the index
Sourcepub fn search(&self, query: &[f32], k: usize) -> Result<Vec<(i64, f32)>>
pub fn search(&self, query: &[f32], k: usize) -> Result<Vec<(i64, f32)>>
Search for k nearest neighbors
Sourcepub fn add_vectors_batch(&mut self, vectors: &[(i64, Vec<f32>)]) -> Result<()>
pub fn add_vectors_batch(&mut self, vectors: &[(i64, Vec<f32>)]) -> Result<()>
Batch add vectors to the index
Sourcepub fn stats(&self) -> TurboQuantStats
pub fn stats(&self) -> TurboQuantStats
Get index statistics
Sourcepub fn remove_vector(&mut self, entity_id: i64) -> Result<()>
pub fn remove_vector(&mut self, entity_id: i64) -> Result<()>
Remove a vector from the index
Sourcepub fn config(&self) -> &TurboQuantConfig
pub fn config(&self) -> &TurboQuantConfig
Get the config
Trait Implementations§
Source§impl Clone for TurboQuantIndex
impl Clone for TurboQuantIndex
Source§fn clone(&self) -> TurboQuantIndex
fn clone(&self) -> TurboQuantIndex
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for TurboQuantIndex
impl Debug for TurboQuantIndex
Source§impl<'de> Deserialize<'de> for TurboQuantIndex
impl<'de> Deserialize<'de> for TurboQuantIndex
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for TurboQuantIndex
impl RefUnwindSafe for TurboQuantIndex
impl Send for TurboQuantIndex
impl Sync for TurboQuantIndex
impl Unpin for TurboQuantIndex
impl UnsafeUnpin for TurboQuantIndex
impl UnwindSafe for TurboQuantIndex
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