pub struct HybridSearch<'a> { /* private fields */ }Expand description
Hybrid search combining dense and sparse retrieval
Implementations§
Source§impl<'a> HybridSearch<'a>
impl<'a> HybridSearch<'a>
Sourcepub fn new(
dense_index: &'a HnswIndex,
sparse_index: &'a SparseIndex,
) -> HybridSearch<'a>
pub fn new( dense_index: &'a HnswIndex, sparse_index: &'a SparseIndex, ) -> HybridSearch<'a>
Create a new hybrid search
Sourcepub fn with_metadata(self, metadata: &'a MetadataStore) -> HybridSearch<'a>
pub fn with_metadata(self, metadata: &'a MetadataStore) -> HybridSearch<'a>
Add metadata store for filtering
Sourcepub fn query(&'a self) -> HybridQueryBuilder<'a>
pub fn query(&'a self) -> HybridQueryBuilder<'a>
Create a query builder
Sourcepub fn search(
&self,
query_vector: Option<&[f32]>,
query_text: Option<&str>,
k: usize,
fusion: FusionMethod,
pre_filter: Option<&HashSet<u64>>,
post_filter: Option<&dyn Fn(&HybridResult) -> bool>,
) -> Vec<HybridResult>
pub fn search( &self, query_vector: Option<&[f32]>, query_text: Option<&str>, k: usize, fusion: FusionMethod, pre_filter: Option<&HashSet<u64>>, post_filter: Option<&dyn Fn(&HybridResult) -> bool>, ) -> Vec<HybridResult>
Execute hybrid search
Sourcepub fn search_dense(
&self,
query_vector: &[f32],
k: usize,
) -> Vec<DistanceResult>
pub fn search_dense( &self, query_vector: &[f32], k: usize, ) -> Vec<DistanceResult>
Dense-only search (for comparison)
Sourcepub fn search_sparse(&self, query_text: &str, k: usize) -> Vec<SparseResult>
pub fn search_sparse(&self, query_text: &str, k: usize) -> Vec<SparseResult>
Sparse-only search (for comparison)
Auto Trait Implementations§
impl<'a> Freeze for HybridSearch<'a>
impl<'a> RefUnwindSafe for HybridSearch<'a>
impl<'a> Send for HybridSearch<'a>
impl<'a> Sync for HybridSearch<'a>
impl<'a> Unpin for HybridSearch<'a>
impl<'a> UnsafeUnpin for HybridSearch<'a>
impl<'a> UnwindSafe for HybridSearch<'a>
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request