search_query
Parsed representation of search query strings. Parsed representation of a search query string with structured filters.
Filter syntax:
is:<type>— filter by entity type (artifact, iteration, task)tag:<name>— filter by tagstatus:<status>— filter by status-<filter>— negate any filter (e.g.-tag:wip)
Same filter types OR-combine; different filter types AND-combine. Exclude filters AND-combine (exclude any match). Unknown prefixes are treated as free text.
const KNOWN_PREFIXES
const KNOWN_PREFIXES: &[&str] = &["is", "status", "tag"];Known filter prefixes (case-insensitive matching is handled by lowercasing the prefix).
enum Filter
pub enum FilterA single filter extracted from the query.
| Variant | Description |
|---|---|
Is(String) |
Matches entities whose type equals the given lowercase name (e.g. task). |
Status(String) |
Matches entities whose status equals the given lowercase name. |
Tag(String) |
Matches entities carrying the given lowercase tag label. |
struct ParsedQuery
pub struct ParsedQueryThe result of parsing a search query string.
| Field | Type | Description |
|---|---|---|
exclude |
Vec<Filter> | Negated filters (prefixed with -) that must not match. |
include |
Vec<Filter> | Filters that must match; same-type filters OR-combine, different-type AND-combine. |
text |
Vec<String> | Free-text tokens to match against entity content. |
Implements Clone, Debug, Default, Eq, PartialEq.
ParsedQuery::is_empty
pub fn is_empty(&self) -> boolReturns true when the query has no filters and no text.
| Parameter | Type | Description |
|---|---|---|
| returns | bool | false when text, include or exclude is not empty. |
fn parse
pub fn parse(query: &str) -> ParsedQueryParse a search query string into a ParsedQuery.
Tokens are split on whitespace. A known prefix with a non-empty value
becomes a filter, with the value lowercased; every other token, including a
bare - and a negated unknown prefix, is kept verbatim as free text.
| Parameter | Type | Description |
|---|---|---|
query |
&str | the raw query string, as the user typed it |
| returns | ParsedQuery | The include filters, exclude filters and free-text tokens, each in the order they appeared. |