zudo-doc
GitHub repository

Type to search...

to open search from anywhere

Site Search

CreatedApr 27, 2026Takeshi Takatsudo

How search works in zudo-doc and how to configure it.

How Search Works

zudo-doc uses MiniSearch for full-text site search. A search index is generated from your content files (title, description, and body text) and served as a single JSON file. The browser loads this index and performs all searching client-side — no server or external service required.

Open the search dialog with:

  • Keyboard shortcut: Ctrl+K (Windows/Linux) or Cmd+K (macOS)
  • Search button: Click the search icon in the header

Type your query and results appear instantly. Click a result to navigate to that page.

Works Everywhere

Search works in all environments:

  • Dev mode (pnpm dev): The search index is generated on-the-fly via Vite middleware
  • Production build (pnpm build): The index is written to search-index.json alongside the static site
  • Electron: Loads the same index file — no special handling needed

💡 Tip

No need to build before testing search. It works immediately with pnpm dev.

Pages with search_exclude: true, draft: true, or unlisted: true in their frontmatter are automatically excluded from the search index.

To explicitly exclude a page, add search_exclude: true to its frontmatter:

---
title: My Internal Page
search_exclude: true
---

💡 Tip

This is useful for pages like changelogs, imported content (e.g., CLAUDE.md), or internal-only pages that would clutter search results.

Search Features

MiniSearch provides:

  • Fuzzy matching: Tolerates typos (up to 20% character difference)
  • Prefix search: Finds results as you type (e.g., “conf” matches “Configuration”)
  • Field boosting: Title matches rank 3x higher than body text, descriptions 2x
  • Instant results: The full index is loaded once and queried in-memory

Server-Side Search (Search Worker)

For large documentation bases or programmatic API access, zudo-doc provides an optional Search Worker — a Cloudflare Worker that runs MiniSearch server-side.

When to Use the Search Worker

The built-in client-side search works well for small-to-medium documentation sites. The Search Worker becomes useful when:

  • Large index size — the full search-index.json is too large for comfortable browser download
  • API consumers — bots, CLI tools, or integrations need search access without a browser
  • Server-side processing — you want to keep the search index off the client

How It Works

The Search Worker fetches the same search-index.json from your deployed site and caches it with a 5-minute TTL. It uses identical MiniSearch configuration (prefix, fuzzy, boost settings), so results are consistent with client-side search.

Comparison

FeatureClient-Side Search (built-in)Search Worker
RuntimeBrowser (in-memory)Cloudflare Workers
Setup requiredNone (enabled by default)Cloudflare account + KV
Index downloadFull index sent to browserIndex stays server-side
Best forSmall-to-medium doc basesLarge doc bases, API consumers
LatencyInstant (local)Network round-trip

For setup instructions, API documentation, and deployment details, see the Search Worker API reference.

Revision History

AI Assistant

Ask a question about the documentation.