Skip to main content

SearchClient

Struct SearchClient 

Source
pub struct SearchClient { /* private fields */ }

Implementations§

Source§

impl SearchClient

Source

pub fn open(index_path: &Path, db_path: Option<&Path>) -> Result<Option<Self>>

Source

pub fn open_with_options( index_path: &Path, db_path: Option<&Path>, options: SearchClientOptions, ) -> Result<Option<Self>>

Source

pub fn search( &self, query: &str, filters: SearchFilters, limit: usize, offset: usize, field_mask: FieldMask, ) -> Result<Vec<SearchHit>>

Source

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<()>

Source

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<()>

Source

pub fn clear_semantic_context(&self) -> Result<()>

Source

pub fn can_progressively_refine(&self) -> bool

Source

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.

Source

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.

Source

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).

Source

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.

Source

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.

Source

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

Source

pub fn total_docs(&self) -> usize

Return the total number of indexed Tantivy documents.

Source

pub fn has_tantivy(&self) -> bool

Returns true if the Tantivy search index is available.

Source

pub fn cache_stats(&self) -> CacheStats

Trait Implementations§

Source§

impl Drop for SearchClient

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

Source§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

Source§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

Source§

fn implicit( self, class: Class, constructed: bool, tag: u32, ) -> TaggedParser<'a, Implicit, Self, E>

Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> Downcast for T
where T: Any,

Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Converts 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>

Converts 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)

Converts &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)

Converts &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 T
where T: Any,

Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert 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>

Convert 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)

Convert &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)

Convert &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
where T: Any + Send,

Source§

fn into_any_send(self: Box<T>) -> Box<dyn Any + Send>

Converts Box<Trait> (where Trait: DowncastSend) to Box<dyn Any + Send>, which can then be downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

Source§

fn into_any_sync(self: Box<T>) -> Box<dyn Any + Send + Sync>

Converts Box<Trait> (where Trait: DowncastSync) to Box<dyn Any + Send + Sync>, which can then be downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>

Converts Arc<Trait> (where Trait: DowncastSync) to Arc<Any>, which can then be downcast into Arc<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

Source§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T> Instrument for T

Source§

fn instrument(self, _span: NoopSpan) -> Self

Instruments this future with a span (no-op when disabled).
Source§

fn in_current_span(self) -> Self

Instruments this future with the current span (no-op when disabled).
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> Fruit for T
where T: Send + Downcast,