# Site Search

## Site Search

**File:** `src/config/config.toml` · **Skill level:** Beginner

Visitors open search with the search button in the header, <kbd>⌘</kbd> + <kbd>K</kbd> (Mac), <kbd>Ctrl</kbd> + <kbd>K</kbd> (Windows and Linux), or <kbd>/</kbd>. Results are grouped by section: pages, blog, changelog, integrations, customers, and docs.

Search is powered by [Pagefind](https://pagefind.app/). It runs entirely in the browser from an index created at the end of `npm run build`, so there is no search service to pay for or set up.

<Aside type="note">
  Search shows "unavailable" in `npm run dev`, because the index doesn't exist
  yet. Test it with `npm run preview` or on your deployed site.
</Aside>

### Settings
```toml
[settings.search]
  enable  = true
  exclude = []    # path prefixes to leave out, for example ["/legal/", "/team/"]
```

Prefixes ignore the language, so `"/team/"` also leaves out `/fr/team/`.

### Leave A Page Out
Add `excludeFromSearch: true` to the page's frontmatter. Some pages are left out automatically:

- pages marked `noindex` (such as log in and sign up) and pages without the site header
- paginated, category, and tag listings, because they only repeat their entries
- the AI and analytics demo homepages and the layout gallery

Only the main content of each page is indexed. The header, footer, and call to action are not, so every result points to real content.

### Turn Search Off
Set `enable = false`. The search button disappears from the header. The build still runs Pagefind; it costs a few seconds and does no harm.