pub struct RetrievalService { /* private fields */ }Expand description
High-level retrieval service
Implementations§
Source§impl RetrievalService
impl RetrievalService
Sourcepub fn with_config(
retriever: Arc<dyn Retriever>,
config: RetrievalServiceConfig,
) -> Self
pub fn with_config( retriever: Arc<dyn Retriever>, config: RetrievalServiceConfig, ) -> Self
Create with configuration
Sourcepub async fn search_text(
&self,
_query: &str,
_limit: Option<usize>,
) -> RragResult<Vec<SearchResult>>
pub async fn search_text( &self, _query: &str, _limit: Option<usize>, ) -> RragResult<Vec<SearchResult>>
Search with text query (requires embedding service)
Sourcepub async fn search_embedding(
&self,
embedding: Embedding,
limit: Option<usize>,
) -> RragResult<Vec<SearchResult>>
pub async fn search_embedding( &self, embedding: Embedding, limit: Option<usize>, ) -> RragResult<Vec<SearchResult>>
Search with pre-computed embedding
Sourcepub async fn search(&self, query: SearchQuery) -> RragResult<Vec<SearchResult>>
pub async fn search(&self, query: SearchQuery) -> RragResult<Vec<SearchResult>>
Advanced search with full query configuration
Sourcepub async fn index_documents(
&self,
documents_with_embeddings: &[(Document, Embedding)],
) -> RragResult<()>
pub async fn index_documents( &self, documents_with_embeddings: &[(Document, Embedding)], ) -> RragResult<()>
Add documents to the index
Sourcepub async fn index_chunks(
&self,
chunks_with_embeddings: &[(DocumentChunk, Embedding)],
) -> RragResult<()>
pub async fn index_chunks( &self, chunks_with_embeddings: &[(DocumentChunk, Embedding)], ) -> RragResult<()>
Add chunks to the index
Sourcepub async fn get_stats(&self) -> RragResult<IndexStats>
pub async fn get_stats(&self) -> RragResult<IndexStats>
Get retriever statistics
Sourcepub async fn health_check(&self) -> RragResult<bool>
pub async fn health_check(&self) -> RragResult<bool>
Health check
Auto Trait Implementations§
impl Freeze for RetrievalService
impl !RefUnwindSafe for RetrievalService
impl Send for RetrievalService
impl Sync for RetrievalService
impl Unpin for RetrievalService
impl !UnwindSafe for RetrievalService
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