pub struct SearchRequest<'e> { /* private fields */ }Implementations§
Source§impl<'e> SearchRequest<'e>
impl<'e> SearchRequest<'e>
Sourcepub fn image_scan(self, scan: ImageScan) -> Self
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.
Sourcepub fn kind_counts(self, enabled: bool) -> Self
pub fn kind_counts(self, enabled: bool) -> Self
Include counts of returned hits by locator kind; no second search is run.
Sourcepub fn roots(self, roots: impl IntoIterator<Item = ResourceId>) -> Self
pub fn roots(self, roots: impl IntoIterator<Item = ResourceId>) -> Self
Add provider-specific roots without filesystem path conversion.
Sourcepub fn query(self, query: impl Into<String>) -> Self
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.
Sourcepub fn paths<I, P>(self, paths: I) -> Self
pub fn paths<I, P>(self, paths: I) -> Self
Add filesystem-only paths, canonicalized locally at execution even with
a custom provider. Use roots() for generic provider identities.
pub fn limit(self, n: usize) -> Self
Sourcepub fn lexical_weight(self, w: f32) -> Self
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.
pub fn mode(self, mode: SearchMode) -> Self
Sourcepub fn min_score(self, s: f32) -> Self
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.
pub fn include(self, glob: impl Into<String>) -> Self
pub fn exclude(self, glob: impl Into<String>) -> Self
pub fn discovery(self, opts: DiscoveryOptions) -> Self
Sourcepub fn previews(self, chars: Option<usize>) -> Self
pub fn previews(self, chars: Option<usize>) -> Self
Maximum preview length in characters, or None to skip reading previews.
pub fn progress(self, f: ProgressFn<'e>) -> Self
Sourcepub fn sync(self, sync: bool) -> Self
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.
Sourcepub fn lexical_fallback(self, enabled: bool) -> Self
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.