Search
Configure search for your documentation
fromsrc includes built-in full-text search with a pluggable adapter system.
Built-in search
The default search works out of the box with full-text content search:
Features
- Full-text body content search
- Fuzzy title/description matching
- Multi-word ranking with exact and prefix boosts
- Typo-tolerant term matching for near-miss queries
- Heading-level results with section anchors
- Content snippets in results
- Keyboard navigation
- Tab autocomplete to top result
- Instant results
Search adapter interface
fromsrc uses a pluggable adapter pattern for search:
Using a custom adapter
Hosted adapters
Orama
Use the built-in Orama adapter for hosted search endpoints:
Algolia
Use the built-in Algolia adapter for remote hosted search:
For hosted adapters, pass lightweight docs metadata to the component and let the provider return ranked results.
Search API
fromsrc includes a typed search route for remote UI and custom clients:
Response fields:
slugtitledescriptionsnippetanchorscore
Response headers:
Server-Timing(search;dur=<ms>)X-Search-Cache(hitormiss)X-Search-Result-Count
Keyboard shortcuts
| shortcut | action |
|---|---|
⌘K / Ctrl+K | open search |
/ | open search (outside inputs) |
↑ / ↓ | navigate results |
Home / End | jump to first / last |
Tab | autocomplete top result |
Enter | go to result |
Escape | close search |
SearchDoc type
The search component accepts an array of searchable documents:
Use getSearchDocs() to get documents with content for full-text search: