config/search.json, serves it from GET /config/search, and the frontend reads it on startup to know which endpoints to query when a user types in the search bar.
How it works
- You run
veloiq search add-modelto register a model and the fields to match against. - The CLI writes (or updates)
config/search.jsonin your backend directory. - The backend serves the configuration at
GET /config/search. - On startup the frontend reads that endpoint and queries the registered model endpoints whenever a user types in the header search input.
Register models and fields
1
Register each model and the fields to search
Run
veloiq search add-model once per model, passing the model class name and a comma-separated list of field names:2
Verify config/search.json
The commands above produce the following file:The
fields array is the union of all fields across every registered model. Field matching is per-model at query time — see Field matching rules below.3
Restart the backend
Restart the backend process (or let uvicorn hot-reload) so the updated
config/search.json is served from GET /config/search.4
Use the search bar
Type in the header search bar. The frontend queries each registered model’s list endpoint and returns matching records alongside any matching navigation pages.
Field matching rules
For each model, only fields whose key exactly matches one of the listed field names, or ends with_<name>, are searched. For example, registering title as a field matches both title and task_title on a model that has that column.
Manage the search configuration
Use these commands to inspect or update the configuration after the initial setup:veloiq search add-field adds the field to the global list. If only specific models have that field, those are the only ones where it will match — fields that do not exist on a model are silently skipped at query time.