pub struct MultiVectorSearcher { /* private fields */ }Expand description
A loaded multi-vector index, ready for MaxSim search.
Implementations§
Source§impl MultiVectorSearcher
impl MultiVectorSearcher
Sourcepub fn num_tokens(&self) -> usize
pub fn num_tokens(&self) -> usize
Total number of token vectors in the index.
Sourcepub fn search(
&self,
query_tokens: &Array2<f32>,
top_k: usize,
) -> Result<Vec<MultiVectorResult>>
pub fn search( &self, query_tokens: &Array2<f32>, top_k: usize, ) -> Result<Vec<MultiVectorResult>>
Approximate MaxSim search.
For each query token, runs HNSW ANN search, then aggregates per-document using the MaxSim formula.
query_tokens has shape [num_query_tokens, dim].
Sourcepub fn search_with_params(
&self,
query_tokens: &Array2<f32>,
top_k: usize,
per_token_k: usize,
) -> Result<Vec<MultiVectorResult>>
pub fn search_with_params( &self, query_tokens: &Array2<f32>, top_k: usize, per_token_k: usize, ) -> Result<Vec<MultiVectorResult>>
Approximate MaxSim search with configurable per-token k.
Sourcepub fn search_exact(
&self,
query_tokens: &Array2<f32>,
top_k: usize,
first_stage_k: usize,
) -> Result<Vec<MultiVectorResult>>
pub fn search_exact( &self, query_tokens: &Array2<f32>, top_k: usize, first_stage_k: usize, ) -> Result<Vec<MultiVectorResult>>
Two-stage exact MaxSim search.
Stage 1: approximate HNSW search to find candidate doc_ids. Stage 2: exact MaxSim reranking using mmap’d embeddings.
Auto Trait Implementations§
impl Freeze for MultiVectorSearcher
impl RefUnwindSafe for MultiVectorSearcher
impl Send for MultiVectorSearcher
impl Sync for MultiVectorSearcher
impl Unpin for MultiVectorSearcher
impl UnsafeUnpin for MultiVectorSearcher
impl UnwindSafe for MultiVectorSearcher
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