pub struct HybridSearcher { /* private fields */ }Expand description
Hybrid search engine that combines vector and text search
Implementations§
Source§impl HybridSearcher
impl HybridSearcher
pub fn new(config: HybridConfig) -> Self
pub fn with_vector_weight(self, weight: f32) -> Self
Sourcepub fn with_fusion_strategy(self, strategy: FusionStrategy) -> Self
pub fn with_fusion_strategy(self, strategy: FusionStrategy) -> Self
CE-14: Override the fusion strategy.
Sourcepub fn search(
&self,
vector_results: Vec<(String, f32, Option<Value>, Option<Vec<f32>>)>,
text_results: Vec<FullTextResult>,
top_k: usize,
) -> Vec<HybridResult>
pub fn search( &self, vector_results: Vec<(String, f32, Option<Value>, Option<Vec<f32>>)>, text_results: Vec<FullTextResult>, top_k: usize, ) -> Vec<HybridResult>
Combine vector search results with full-text search results.
Dispatches to Self::rrf_search (RRF, default) or Self::minmax_search
depending on config.fusion_strategy.
§Arguments
vector_results- Results from vector similarity search (id, score, metadata, vector)text_results- Results from full-text BM25 searchtop_k- Number of results to return
Trait Implementations§
Auto Trait Implementations§
impl Freeze for HybridSearcher
impl RefUnwindSafe for HybridSearcher
impl Send for HybridSearcher
impl Sync for HybridSearcher
impl Unpin for HybridSearcher
impl UnsafeUnpin for HybridSearcher
impl UnwindSafe for HybridSearcher
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