pub struct HybridIndex { /* private fields */ }Expand description
Hybrid index combining learned index for static data with HNSW for dynamic updates
Implementations§
Source§impl HybridIndex
impl HybridIndex
Sourcepub fn new(
dimensions: usize,
num_leaf_models: usize,
rebuild_threshold: usize,
) -> Self
pub fn new( dimensions: usize, num_leaf_models: usize, rebuild_threshold: usize, ) -> Self
Create a new hybrid index
Sourcepub fn build_static(&mut self, data: Vec<(Vec<f32>, VectorId)>) -> Result<()>
pub fn build_static(&mut self, data: Vec<(Vec<f32>, VectorId)>) -> Result<()>
Build the learned portion from static data
Sourcepub fn needs_rebuild(&self) -> bool
pub fn needs_rebuild(&self) -> bool
Check if rebuild is needed
Trait Implementations§
Source§impl LearnedIndex for HybridIndex
impl LearnedIndex for HybridIndex
Source§fn stats(&self) -> IndexStats
fn stats(&self) -> IndexStats
Get index statistics
Auto Trait Implementations§
impl Freeze for HybridIndex
impl RefUnwindSafe for HybridIndex
impl Send for HybridIndex
impl Sync for HybridIndex
impl Unpin for HybridIndex
impl UnwindSafe for HybridIndex
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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