pub struct SearchClient { /* private fields */ }Implementations§
Source§impl SearchClient
impl SearchClient
pub fn open(index_path: &Path, db_path: Option<&Path>) -> Result<Option<Self>>
pub fn open_with_options( index_path: &Path, db_path: Option<&Path>, options: SearchClientOptions, ) -> Result<Option<Self>>
pub fn search( &self, query: &str, filters: SearchFilters, limit: usize, offset: usize, field_mask: FieldMask, ) -> Result<Vec<SearchHit>>
pub fn set_semantic_context( &self, embedder: Arc<dyn Embedder>, fs_semantic_index: VectorIndex, filter_maps: SemanticFilterMaps, roles: Option<HashSet<u8>>, ann_path: Option<PathBuf>, ) -> Result<()>
pub fn set_semantic_indexes_context( &self, embedder: Arc<dyn Embedder>, fs_semantic_indexes: Vec<VectorIndex>, filter_maps: SemanticFilterMaps, roles: Option<HashSet<u8>>, ann_path: Option<PathBuf>, ) -> Result<()>
pub fn clear_semantic_context(&self) -> Result<()>
pub fn can_progressively_refine(&self) -> bool
Sourcepub fn search_semantic(
&self,
query: &str,
filters: SearchFilters,
limit: usize,
offset: usize,
field_mask: FieldMask,
approximate: bool,
) -> Result<(Vec<SearchHit>, Option<AnnSearchStats>)>
pub fn search_semantic( &self, query: &str, filters: SearchFilters, limit: usize, offset: usize, field_mask: FieldMask, approximate: bool, ) -> Result<(Vec<SearchHit>, Option<AnnSearchStats>)>
Semantic search result containing hits and optional ANN statistics.
Sourcepub fn search_semantic_with_tier(
&self,
query: &str,
filters: SearchFilters,
limit: usize,
offset: usize,
field_mask: FieldMask,
approximate: bool,
tier_mode: SemanticTierMode,
) -> Result<(Vec<SearchHit>, Option<AnnSearchStats>)>
pub fn search_semantic_with_tier( &self, query: &str, filters: SearchFilters, limit: usize, offset: usize, field_mask: FieldMask, approximate: bool, tier_mode: SemanticTierMode, ) -> Result<(Vec<SearchHit>, Option<AnnSearchStats>)>
Semantic search with optional progressive two-tier execution strategy.
Sourcepub fn search_with_fallback(
&self,
query: &str,
filters: SearchFilters,
limit: usize,
offset: usize,
sparse_threshold: usize,
field_mask: FieldMask,
) -> Result<SearchResult>
pub fn search_with_fallback( &self, query: &str, filters: SearchFilters, limit: usize, offset: usize, sparse_threshold: usize, field_mask: FieldMask, ) -> Result<SearchResult>
Search with automatic wildcard fallback for sparse results.
If the initial search returns fewer than sparse_threshold results and the query
doesn’t already contain wildcards, automatically retry with substring wildcards (term).
Sourcepub fn search_hybrid(
&self,
lexical_query: &str,
semantic_query: &str,
filters: SearchFilters,
limit: usize,
offset: usize,
sparse_threshold: usize,
field_mask: FieldMask,
approximate: bool,
) -> Result<SearchResult>
pub fn search_hybrid( &self, lexical_query: &str, semantic_query: &str, filters: SearchFilters, limit: usize, offset: usize, sparse_threshold: usize, field_mask: FieldMask, approximate: bool, ) -> Result<SearchResult>
Hybrid search that fuses lexical + semantic results with RRF.
Sourcepub fn search_hybrid_with_tier(
&self,
lexical_query: &str,
semantic_query: &str,
filters: SearchFilters,
limit: usize,
offset: usize,
sparse_threshold: usize,
field_mask: FieldMask,
approximate: bool,
semantic_tier_mode: SemanticTierMode,
) -> Result<SearchResult>
pub fn search_hybrid_with_tier( &self, lexical_query: &str, semantic_query: &str, filters: SearchFilters, limit: usize, offset: usize, sparse_threshold: usize, field_mask: FieldMask, approximate: bool, semantic_tier_mode: SemanticTierMode, ) -> Result<SearchResult>
Hybrid search that fuses lexical + semantic results with optional progressive two-tier semantic execution.
Sourcepub fn browse_by_date(
&self,
filters: SearchFilters,
limit: usize,
offset: usize,
newest_first: bool,
field_mask: FieldMask,
) -> Result<Vec<SearchHit>>
pub fn browse_by_date( &self, filters: SearchFilters, limit: usize, offset: usize, newest_first: bool, field_mask: FieldMask, ) -> Result<Vec<SearchHit>>
Browse messages ordered by date, without any text query.
Used when the TUI query is empty and the user wants to see recent (or
oldest) sessions. Bypasses BM25 scoring entirely and returns results
ordered by created_at. Applies agent, workspace, time-range, and
source filters identically to the normal search path.
Source§impl SearchClient
impl SearchClient
Sourcepub fn total_docs(&self) -> usize
pub fn total_docs(&self) -> usize
Return the total number of indexed Tantivy documents.
Sourcepub fn has_tantivy(&self) -> bool
pub fn has_tantivy(&self) -> bool
Returns true if the Tantivy search index is available.
pub fn cache_stats(&self) -> CacheStats
Trait Implementations§
Source§impl Drop for SearchClient
impl Drop for SearchClient
Auto Trait Implementations§
impl !Freeze for SearchClient
impl !RefUnwindSafe for SearchClient
impl Send for SearchClient
impl Sync for SearchClient
impl Unpin for SearchClient
impl UnsafeUnpin for SearchClient
impl !UnwindSafe for SearchClient
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, _span: NoopSpan) -> Self
fn instrument(self, _span: NoopSpan) -> Self
Source§fn in_current_span(self) -> Self
fn in_current_span(self) -> 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>
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>
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