pub enum AnyIndex {
Hnsw(HnswIndex),
IvfPq(IvfPqIndex),
}Expand description
Unified index type: dispatches search to HNSW or IVF-PQ.
Variants§
Hnsw(HnswIndex)
IvfPq(IvfPqIndex)
Implementations§
Source§impl AnyIndex
impl AnyIndex
Sourcepub fn search(
&self,
query: &[f32],
top_k: usize,
ef: usize,
) -> Vec<(RowId, f32)>
pub fn search( &self, query: &[f32], top_k: usize, ef: usize, ) -> Vec<(RowId, f32)>
Search. ef is used for HNSW; ignored for IVF-PQ.
pub fn node_count(&self) -> u64
Sourcepub fn quantize_to_f16(&mut self)
pub fn quantize_to_f16(&mut self)
Quantize stored vectors to F16 for HNSW search (no-op for IVF-PQ).
pub fn is_hnsw(&self) -> bool
pub fn is_ivf_pq(&self) -> bool
Auto Trait Implementations§
impl Freeze for AnyIndex
impl RefUnwindSafe for AnyIndex
impl Send for AnyIndex
impl Sync for AnyIndex
impl Unpin for AnyIndex
impl UnsafeUnpin for AnyIndex
impl UnwindSafe for AnyIndex
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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