Add client-side full-text search for all doc pages #63

Closed
opened 2026-03-21 19:27:38 +00:00 by kert · 0 comments
Owner

Problem

The navbar search container is empty — no search plugin is configured. 450+ doc pages (API, CLI, REST API, pipelines, DAG) are not searchable. The empty navbarSearchContainer_Bca1 div renders nothing.

Fix

Install @easyops-cn/docusaurus-search-local — a client-side Lunr-based search that indexes at build time. No external service needed.

Steps:

  1. cd docs && npm install @easyops-cn/docusaurus-search-local
  2. Add to docusaurus.config.js themes array:
themes: [
  ['@easyops-cn/docusaurus-search-local', {
    hashed: true,
    language: ['en'],
    indexDocs: true,
    indexPages: true,
    docsRouteBasePath: '/',
  }],
],
  1. Rebuild — the plugin generates a search index at build time
  2. Verify: search bar appears in navbar, queries return results

Why not Algolia?

  • Requires external hosted service + API keys
  • Self-hosted DocSearch is complex
  • Local search is zero-dependency, works offline, indexes at build time

Files

  • docs/package.json
  • docs/docusaurus.config.js
## Problem The navbar search container is empty — no search plugin is configured. 450+ doc pages (API, CLI, REST API, pipelines, DAG) are not searchable. The empty `navbarSearchContainer_Bca1` div renders nothing. ## Fix Install `@easyops-cn/docusaurus-search-local` — a client-side Lunr-based search that indexes at build time. No external service needed. ### Steps: 1. `cd docs && npm install @easyops-cn/docusaurus-search-local` 2. Add to `docusaurus.config.js` themes array: ```js themes: [ ['@easyops-cn/docusaurus-search-local', { hashed: true, language: ['en'], indexDocs: true, indexPages: true, docsRouteBasePath: '/', }], ], ``` 3. Rebuild — the plugin generates a search index at build time 4. Verify: search bar appears in navbar, queries return results ### Why not Algolia? - Requires external hosted service + API keys - Self-hosted DocSearch is complex - Local search is zero-dependency, works offline, indexes at build time ## Files - `docs/package.json` - `docs/docusaurus.config.js`
kert added this to the P13: Docs Search — local search, library data, broken links, tests milestone 2026-03-21 19:27:38 +00:00
kert added the docs label 2026-03-21 19:27:38 +00:00
kert closed this issue 2026-03-21 19:34:12 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: homelab/stack#63