pub struct SearchRequest {
pub envelope_version: u32,
pub pattern: String,
pub search_path: String,
pub mode: SearchMode,
pub kind: Option<String>,
pub lang: Option<String>,
pub limit: Option<u32>,
pub include_generated: bool,
pub revision: Option<RevisionQueryTarget>,
}Expand description
daemon/search request payload.
Submitted as the params field of a JsonRpcRequest with
method == "daemon/search". Wire-compatible with --exact, regex, and
fuzzy search modes; the daemon handler dispatches to the same
find_by_exact_name / regex / fuzzy logic the in-process CLI uses
(verifiable by the DAEMON_SEARCH_TESTS parity assertions).
Errors: a request whose search_path does not resolve to a
daemon-loaded workspace returns WorkspaceEvicted (-32004) or
WorkspaceNotLoaded; an incompatible plugin selection returns
WorkspaceIncompatibleGraph (-32005). The CLI shim treats either as
a soft failure and falls through to the in-process path.
Fields§
§envelope_version: u32Wire envelope version. Defaults to ENVELOPE_VERSION for
forward-compatible serde when the field is absent.
pattern: StringPattern to search for. Interpreted per mode.
search_path: StringWorkspace root the search should resolve against. The daemon
normalises and looks this up via WorkspaceManager.
mode: SearchModeSearch interpretation mode. Maps to the CLI’s --exact / --fuzzy
flags; everything else falls into SearchMode::Regex.
kind: Option<String>Optional kind filter (e.g. "function", "class"). Matches
the in-process Cli::kind semantics.
lang: Option<String>Optional language filter (e.g. "rust", "python").
limit: Option<u32>Maximum result count. None lets the daemon apply its default
(mirrors Cli::limit).
include_generated: boolMirror of the CLI’s --include-generated flag (default in-process:
false — macro-generated symbols are dropped). When false the
daemon applies the same filter_nodes_by_macro_boundary contract
as sqry-cli/src/commands/search.rs::run_regular_search so the
daemon route does not surface macro-generated symbols the
in-process path would have dropped.
Serde default is true for backward compatibility — a request
body that omits the field gets the same “no filter” behaviour
the tier-2 daemon handler shipped with originally (the
DAEMON_SEARCH_HANDLER unit’s approved tests rely on that
default and continue to pass without modification).
revision: Option<RevisionQueryTarget>Optional explicit revision target. When absent, daemon search keeps
the legacy behavior and queries only the live workspace identified by
search_path.