feat(wiki): full-text search across wiki pages #550

Open
opened 2026-06-06 23:20:00 +00:00 by jmiller · 0 comments
Owner

Add search functionality to the wiki so users can find content across all pages and folders. Should include keyword search in page titles and content, with results showing matched context snippets.

Design

Routes

  • Web: GET /:owner/:repo/wiki?action=_search&q=term
  • API: GET /api/v1/repos/:owner/:repo/wiki/search?q=term

Implementation

  • Use git grep against the wiki git repo — fast, requires no index, works with git-based storage
  • Search both page titles (filename matching) and page content (full-text)
  • Return results with page title, matching line context (like GitHub code search), and link to page

UI

  • Add a search input to the wiki header bar (next to the page dropdown)
  • Results page showing: page name, matching lines with highlighted terms, link to page
  • Keyboard shortcut to focus search (e.g., /)

Files to Modify

File Change
routers/web/repo/wiki.go New WikiSearch() handler
routers/api/v1/repo/wiki.go New API search endpoint
templates/repo/wiki/search.tmpl New — search results page
templates/repo/wiki/view.tmpl Add search input to header

Merged from #545

Add search functionality to the wiki so users can find content across all pages and folders. Should include keyword search in page titles and content, with results showing matched context snippets. ## Design ### Routes - **Web:** `GET /:owner/:repo/wiki?action=_search&q=term` - **API:** `GET /api/v1/repos/:owner/:repo/wiki/search?q=term` ### Implementation - Use `git grep` against the wiki git repo — fast, requires no index, works with git-based storage - Search both page titles (filename matching) and page content (full-text) - Return results with page title, matching line context (like GitHub code search), and link to page ### UI - Add a search input to the wiki header bar (next to the page dropdown) - Results page showing: page name, matching lines with highlighted terms, link to page - Keyboard shortcut to focus search (e.g., `/`) ### Files to Modify | File | Change | |------|--------| | `routers/web/repo/wiki.go` | New `WikiSearch()` handler | | `routers/api/v1/repo/wiki.go` | New API search endpoint | | `templates/repo/wiki/search.tmpl` | New — search results page | | `templates/repo/wiki/view.tmpl` | Add search input to header | *Merged from #545*
jmiller added the feature: wiki label 2026-06-21 13:41:46 +00:00
Sign in to join this conversation.