search
Search handlers (HTML page + JSON API).
struct ApiSearchParams
pub struct ApiSearchParamsQuery parameters for the JSON search API.
| Field | Type | Description |
|---|---|---|
q |
Option<String> | The search text in gest’s query syntax; empty or missing gives an empty list. |
Implements Deserialize<'de>.
struct SearchQuery
pub struct SearchQueryQuery parameters for the HTML search page.
| Field | Type | Description |
|---|---|---|
q |
Option<String> | The search text in gest’s query syntax; empty or missing shows the page with no results. |
Implements Deserialize<'de>.
struct ApiSearchResult
struct ApiSearchResultJSON result returned from /api/search.
| Field | Type | Description |
|---|---|---|
id |
String | The full id of the entity. |
kind |
String | The entity type, task, artifact or iteration, serialized as type. |
short_id |
String | The short id prefix that the UI displays. |
title |
String | The entity’s title, shown in the relationship picker. |
Implements Serialize.
struct SearchTemplate
struct SearchTemplateThe search page, with the query box and its results grouped by entity type.
| Field | Type | Description |
|---|---|---|
artifacts |
Vec<artifact::Model> | Artifacts that match the query; empty when the query is empty. |
iterations |
Vec<iteration::Model> | Iterations that match the query; empty when the query is empty. |
query |
String | The search text, shown back in the query box. |
tasks |
Vec<task::Model> | Tasks that match the query; empty when the query is empty. |
Implements Template, Display, FastWritable.
fn api_search
pub async fn api_search(
State(state): State<AppState>,
Query(params): Query<ApiSearchParams>,
) -> ResponseGET /api/search?q=… — JSON search results for the relationship picker.
The search passes show_all, so resolved tasks, archived artifacts and completed or cancelled iterations match too.
| Parameter | Type | Description |
|---|---|---|
State(state) |
State<AppState> | the shared app state, for the store and the project id |
Query(params) |
Query<ApiSearchParams> | the query string, holding the search text |
| returns | Response | A JSON array of matches, tasks first, then artifacts, then iterations; an empty array for empty text, and an empty array with 500 when the store fails. |
fn search
pub async fn search(
State(state): State<AppState>,
Query(params): Query<SearchQuery>,
) -> Result<Html<String>, web::Error>Search page.
| Parameter | Type | Description |
|---|---|---|
State(state) |
State<AppState> | the shared app state, for the store and the project id |
Query(params) |
Query<SearchQuery> | the query string, holding the search text |
| returns | Result<Html<String>, web::Error> | The rendered page with the matching tasks, artifacts and iterations, or a web::Error when the store or the template fails. |