Search
The search page
Section titled “The search page”/search/?q= lists the entries whose title, excerpt or body text (entries.body_text) contain
every word, ranked by relevance (Loader.queryRanked):
- the phrase in the title,
- then words in the title, excerpt and text,
- newest first on ties.
It searches the types chosen under Settings > Search (settings.site.search_types, searchTypes);
by default all types with a page. It renders the search template (src/lib/content/search-template.ts),
else index. The page is noindex.
The search form
Section titled “The search form”The search-form block is a GET form to /search/. On any page with a .c-search-form, the page
shell adds public/assets/js/search.js: live results under the field as an ARIA combobox (arrows,
Enter; Escape closes only the list).
A form sets these as data attributes:
| Attribute | Effect |
|---|---|
data-types |
Narrows the types (any with a page of its own) |
data-taxonomy |
Adds that taxonomy’s terms in use to the suggestions |
data-input |
The field’s name (default q) |
data-all |
false leaves out the link to all results |
Picking a term fires a cancelable c-search:term event on the form.
GET /api/search?q=&limit=&types=&taxonomy= returns JSON, cached at the CDN for a minute.