Built-in Search

Full-text search powered by a build-time index with fuzzy matching and keyboard navigation.

DocuBook Flame includes a built-in full-text search that works entirely client-side — no external services required. The search index is generated at build time and loaded on demand.

How It Works

  1. Build-time indexing — During flame build, all MDX files are scanned and a search-index.json is generated
  2. Hierarchy-based records — Each page produces multiple records: title (lvl1), headings (lvl2–lvl6), and content paragraphs
  3. Client-side search — The index is fetched on first modal open and cached in memory

Features

  • Fuzzy matching — Tolerates typos using Levenshtein distance
  • Weighted scoring — Title matches rank higher than heading matches, which rank higher than content matches
  • Grouped results — Results are grouped by section (lvl0) with appropriate icons per type
  • Keyboard navigation — Full keyboard support: ⌘K to open, ↑↓ to navigate, Enter to select, Esc to close

Keyboard Shortcuts

ShortcutAction
⌘ + K / Ctrl + KOpen search modal
↑ ↓Navigate results
EnterGo to selected result
EscClose modal

Search Scope

The indexer extracts the following from each MDX file:

  • lvl0 — Section name (from route configuration)
  • lvl1 — Page title (from frontmatter)
  • lvl2–lvl6 — Headings (h2 through h6)
  • content — First paragraph after each heading

Configuration

Search works out of the box with no configuration. The index is automatically regenerated on every build.

To search with Algolia DocSearch instead, and add Ask AI, install the Algolia plugin. A search plugin replaces this dialog; the sidebar search bar and ⌘ K stay where they are.

Last updated Nov 6, 2026