Full-Text Search
Stardust includes powerful full-text search that works entirely client-side—no API keys, no external services, no tracking.
How It Works
Search is powered by Pagefind, which creates a compact search index during build time. When users search:
- The search UI loads instantly
- Only the relevant index chunks are downloaded (typically 10-50KB)
- Results appear as you type
- Everything runs in the browser
Using Search
Opening Search
- Click the search icon in the header
- Press
/(default hotkey) - Press
Cmd+K(Mac) orCtrl+K(Windows/Linux)
Keyboard Navigation
| Key | Action |
|---|---|
↑ / ↓ |
Navigate through results |
Enter |
Go to selected result |
Escape |
Close search dialog |
Search Tips
- Simple searches: Just type keywords like
configurationordark mode - Multiple terms:
sidebar navigationfinds pages with both terms - Phrases:
"code blocks"with quotes for exact phrases
Configuration
Search works with zero configuration, but you can customize it:
search:
enabled: true
placeholder: "Search documentation..."
hotkey: "/"
See Search Configuration for all options.
Search Quality
Stardust optimizes search results by:
- Giving higher weight to headings and titles
- Including page descriptions in the index
- Preserving code block content for searchability
- Generating contextual snippets for results
Improve Your Search Results
💡 Tip
- Write clear, descriptive headings
- Add page descriptions in frontmatter
- Use consistent terminology
- Break content into logical sections
Excluding Content
Exclude Entire Pages
---
title: Internal Notes
search: false
---
Exclude Sections
Wrap content to exclude it from the search index:
<div data-pagefind-ignore>
This content won't appear in search results.
</div>
Search Index Size
Pagefind creates an extremely efficient index:
| Documentation Size | Typical Index Size |
|---|---|
| 10 pages | 5-15 KB |
| 50 pages | 25-75 KB |
| 200 pages | 100-300 KB |
| 1000 pages | 500 KB - 1.5 MB |
Users only download chunks relevant to their search query.
Algolia Alternative
For very large documentation sites (1000+ pages) or advanced features like AI search, you can use Algolia:
search:
provider: algolia
algolia:
appId: YOUR_APP_ID
apiKey: YOUR_SEARCH_API_KEY
indexName: YOUR_INDEX_NAME
Apply for free DocSearch for open-source projects.
Development Mode
During stardust dev, search uses a temporary index that updates as you edit. The full optimized index is generated during stardust build.