Skip to main content

SearchRequest

Struct SearchRequest 

Source
pub struct SearchRequest<'e> { /* private fields */ }

Implementations§

Source§

impl<'e> SearchRequest<'e>

Source

pub fn image_scan(self, scan: ImageScan) -> Self

Opt into experimental Photo Anchor candidate scanning for standalone images. Exact f32 reranking preserves returned score semantics. Requires SQLite; a bounded shortlist does not guarantee recall on arbitrary libraries.

Source

pub fn kind_counts(self, enabled: bool) -> Self

Include counts of returned hits by locator kind; no second search is run.

Source

pub fn roots(self, roots: impl IntoIterator<Item = ResourceId>) -> Self

Add provider-specific roots without filesystem path conversion.

Source

pub fn query(self, query: impl Into<String>) -> Self

Search for another phrasing too. Each segment is ranked by its best score over all queries, so rephrasing widens recall without diluting scores.

Source

pub fn paths<I, P>(self, paths: I) -> Self
where I: IntoIterator<Item = P>, P: AsRef<Path>,

Add filesystem-only paths, canonicalized locally at execution even with a custom provider. Use roots() for generic provider identities.

Source

pub fn limit(self, n: usize) -> Self

Source

pub fn lexical_weight(self, w: f32) -> Self

Override how much keyword rank counts against semantic rank in hybrid mode (semantic is 1). By default it depends on the query, see [keyword_weight]. Must be finite and non-negative; zero disables the keyword signal in hybrid mode. Valid overrides are ignored in other modes.

Source

pub fn mode(self, mode: SearchMode) -> Self

Source

pub fn min_score(self, s: f32) -> Self

Hide semantic matches below this cosine similarity. Keyword and file name matches are kept: their relevance is not a cosine.

Source

pub fn include(self, glob: impl Into<String>) -> Self

Source

pub fn exclude(self, glob: impl Into<String>) -> Self

Source

pub fn discovery(self, opts: DiscoveryOptions) -> Self

Source

pub fn previews(self, chars: Option<usize>) -> Self

Maximum preview length in characters, or None to skip reading previews.

Source

pub fn progress(self, f: ProgressFn<'e>) -> Self

Source

pub fn sync(self, sync: bool) -> Self

With false, search only what is already cached and embed nothing. For callers where a separate indexer (see watch) keeps the cache fresh, so a search never waits for a large first index. Changed files may be stale.

Source

pub fn lexical_fallback(self, enabled: bool) -> Self

Allow a cached search to prepare an ephemeral keyword index when any supported resource is new or changed. Never waits for embedding or writes to the semantic cache. Providers opting into cached listing retain their indexed-only scope; their background indexer discovers new resources. Without this opt-in, sync(false) stays cache-only.

Source

pub fn execute(self) -> Result<SearchResults>

Auto Trait Implementations§

§

impl<'e> !RefUnwindSafe for SearchRequest<'e>

§

impl<'e> !UnwindSafe for SearchRequest<'e>

§

impl<'e> Freeze for SearchRequest<'e>

§

impl<'e> Send for SearchRequest<'e>

§

impl<'e> Sync for SearchRequest<'e>

§

impl<'e> Unpin for SearchRequest<'e>

§

impl<'e> UnsafeUnpin for SearchRequest<'e>

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<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> ErasedDestructor for T
where T: 'static,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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<F, T> IntoSample<T> for F
where T: FromSample<F>,

Source§

fn into_sample(self) -> T

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, S> SimdFrom<T, S> for T
where S: Simd,

Source§

fn simd_from(value: T, _simd: S) -> T

Source§

impl<F, T, S> SimdInto<T, S> for F
where T: SimdFrom<F, S>, S: Simd,

Source§

fn simd_into(self, simd: S) -> T

Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.