pub struct LinearScanIndex { /* private fields */ }Expand description
Linear scan index for comparison (exact search)
Implementations§
Source§impl LinearScanIndex
impl LinearScanIndex
Sourcepub fn new(config: TurboQuantConfig) -> Result<Self>
pub fn new(config: TurboQuantConfig) -> Result<Self>
Create a new linear scan 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 using exact cosine similarity
Sourcepub fn stats(&self) -> LinearScanStats
pub fn stats(&self) -> LinearScanStats
Get index statistics
Auto Trait Implementations§
impl Freeze for LinearScanIndex
impl RefUnwindSafe for LinearScanIndex
impl Send for LinearScanIndex
impl Sync for LinearScanIndex
impl Unpin for LinearScanIndex
impl UnsafeUnpin for LinearScanIndex
impl UnwindSafe for LinearScanIndex
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