pub struct HybridRetrievalService { /* private fields */ }Expand description
Hybrid retrieval service combining BM25 and vector search
Implementations§
Source§impl HybridRetrievalService
impl HybridRetrievalService
pub fn new( embedding_service: Arc<dyn EmbeddingService>, config: HybridRetrievalConfig, ) -> Self
Sourcepub async fn retrieve<R: DocumentRepository + ?Sized>(
&self,
repository: &R,
queries: &[String],
session_id: &str,
) -> Result<Vec<Candidate>>
pub async fn retrieve<R: DocumentRepository + ?Sized>( &self, repository: &R, queries: &[String], session_id: &str, ) -> Result<Vec<Candidate>>
Perform hybrid retrieval combining lexical and semantic search
Sourcepub fn calculate_zscores(&self, candidates: &[Candidate]) -> Vec<Candidate>
pub fn calculate_zscores(&self, candidates: &[Candidate]) -> Vec<Candidate>
Calculate z-scores for normalized candidate scores
Sourcepub fn mock_for_testing() -> Self
pub fn mock_for_testing() -> Self
Create a mock service for testing without embedding dependencies
Auto Trait Implementations§
impl Freeze for HybridRetrievalService
impl !RefUnwindSafe for HybridRetrievalService
impl Send for HybridRetrievalService
impl Sync for HybridRetrievalService
impl Unpin for HybridRetrievalService
impl !UnwindSafe for HybridRetrievalService
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