Tibi Search
Tibi search combines frontend suggestion UIs, WordPress REST endpoints, and Algolia-backed query overrides. Treat global search and Help search as separate user journeys.
Search Areas
| Area | User-facing behavior | Primary code |
|---|---|---|
| Global header search | Lets users switch between library search and web search suggestions. | packages/wordpress/themes/tibi/src/search.tsx |
| Help search autocomplete | Searches tibi-help and tibi-faq while typing on Help surfaces. |
tibi/help-search |
| Help landing result page | Converts Help landing ?s= requests into paginated Help-only search results. |
packages/wordpress/themes/tibi/inc/templating.php |
| Search query rules | Restricts old global search post types and controls Algolia overrides. | packages/wordpress/themes/tibi/inc/query.php, inc/algolia.php |
Global Search
The header search has two modes:
| Mode | Suggestions | Submit target |
|---|---|---|
| Library | Fetches /boker/search/suggestion?searchPhrase=... |
/boker/søk?query=... |
| Web | Fetches /wp-json/wp/v2/search?search=... |
/?s=... |
Readable result labels are normalized in search.tsx: post becomes Aktuelt, page becomes Side, brukerveiledninger and tibi-help become Brukerveiledning, and t2-faq/tibi-faq become Ofte stilte spørsmål.
Help Search
Full block reference: Help search block.
Help autocomplete is exposed by tibi/help-search.
| Piece | Behavior |
|---|---|
| REST endpoint | GET /wp-json/tibi/v1/help-search?q={term}&per_page={number} |
| Searched post types | tibi-help, tibi-faq |
| Response items | ID, title, URL, post type, readable type label. |
| Algolia flag | The query sets use_algolia => true, so Algolia can power the result ordering when available. |
| Minimum frontend length | Help autocomplete defaults to 2 characters. |
The Help landing page has additional server-side behavior:
?s=on the Help landing page is forced into a real search query.- Results are limited to
tibi-helpandtibi-faq. - Pagination uses query-string URLs so
/page/2/does not break the landing-page request. help-categoryis preserved during pagination and applied to the query.
Algolia Rules
Tibi customizes Algolia in packages/wordpress/themes/tibi/inc/algolia.php.
- Alphabetical sorting removes the unused descending title sort.
- Proxy settings are added to the Algolia HTTP client when WordPress proxy constants are enabled.
- Empty and too-short anti-spam filters are disabled at the Algolia layer, but query override is still blocked for empty searches and normalized searches shorter than 3 characters.
- Help category filters are converted from a selected slug into the term name expected by Algolia filters.
Legacy Search Restrictions
When the new Help version is not enabled, global search is restricted to:
postpaget2-faqbrukerveiledninger
Dedicated Help searches are excluded from this restriction so tibi-help and tibi-faq continue to work.
Editor Notes
- Published titles matter because both global and Help suggestions display title text directly.
- Help content must use the right
Hjelpekategorierterm if it should appear under category filtering. - If a published item does not appear in search, check indexing and post type eligibility before rewriting content.
- Test on stage first:
https://beta.tibi.no.
Operational Checks
After search changes:
- Rebuild/reindex the relevant Algolia index.
- Test global search in both Library and Web modes.
- Test Help autocomplete and the Help landing result page.
- Test both Bokmal and Nynorsk terms where relevant.
- Confirm no unpublished/private content appears in public search results.