Skip to content
This repository was archived by the owner on Oct 27, 2026. It is now read-only.

Replace Algolia with Fumadocs built-in search - #1255

Draft
sdserranog wants to merge 6 commits into
mainfrom
exp/builtin-search-compare
Draft

sdserranog wants to merge 6 commits into
mainfrom
exp/builtin-search-compare

Conversation

@sdserranog

@sdserranog sdserranog commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

What this does

Switches the docs search from Algolia to Fumadocs' built-in search, after the team liked it in the comparison (demo kept in #1257).

  • Search button and Cmd/Ctrl + K now open the Fumadocs search dialog, which reads from /api/search
  • Removes the Algolia search component, crawler config, the two Algolia GitHub workflows, the sync script, and the NEXT_PUBLIC_ALGOLIA_* env vars
  • Removes the algoliasearch and react-instantsearch dependencies
  • Shows suggested pages while the search box is empty, shows Ctrl instead of the Mac command key on Windows and Linux, caches /api/search responses on the CDN, and cuts queries to 200 characters
  • Removes the /en/search-compare demo page (it lives on in Demo: compare Algolia with Fumadocs built-in search #1257)
  • Updates CLAUDE.md and toolkit-docs-generator/ARCHITECTURE.md

The search index (page content plus toolkit pages) and tuning (typo tolerance, stemming, title boost) are the same as in the comparison. Results come from the comparison in #1257: roughly a tie with Algolia, better on integrations, a bit worse on typos.

Things to know

  • Results are whole pages, not sections like Algolia's
  • Search analytics moved to PostHog: a Docs search event (query, result count) once the user pauses typing, and Docs search result selected
  • After merging, the ALGOLIA_CRAWLER_* secrets and variables in repo settings can be deleted, and the Algolia crawler can be turned off

Testing

  • bun run typecheck, lint, and bun run test pass
  • /api/search returns the right pages for api key, gmial, Gmail.SendEmail and on prem
  • I clicked through the dialog locally on a Mac (open, type, Enter, empty-state suggestions, both PostHog events). Please check the Vercel preview for light mode, mobile, Ctrl+K on Windows/Linux, and how long the first search takes after a cold start

Note

Medium Risk
Docs search is a user-facing surface with new indexing, caching, and analytics behavior; results are page-level rather than section-level, which may change discoverability compared to Algolia.

Overview
Replaces Algolia docs search with Fumadocs’ built-in search served from a new /api/search route. The navbar and mobile menu use a SearchButton that opens a lazy-loaded search-dialog wired through AppRootProvider, with empty-state suggestions from SEARCH_SUGGESTIONS.

Indexing and behavior: lib/builtin-search.ts builds the index at request time from MDX pages (via Fumadocs source) and generated toolkit JSON (tool names/descriptions), with English stemming, typo tolerance, and title/URL keyword boosting. The API route adds CDN cache headers and truncates queries to 200 characters. search-dialog adds PostHog events for settled queries and result clicks.

Removed: Algolia crawler config and docs, algolia-reindex / sync-crawler-config workflows, sync-crawler-config script, NEXT_PUBLIC_ALGOLIA_* env vars, and algoliasearch / react-instantsearch dependencies. tests/builtin-search.test.ts covers ranking, suggestions, caching, and long-query handling.

Reviewed by Cursor Bugbot for commit 5397117. Bugbot is set up for automated code reviews on this repo. Configure here.

Adds /en/search-compare, which runs the same query against Algolia and
Fumadocs' built-in search (ZBSearch) side by side. The live search dialog
still uses Algolia. Not meant to merge.
@vercel

vercel Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
docs Ready Ready Preview Oct 22, 2026 8:09pm UTC

Request Review

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

Comment thread components/search-compare.tsx Outdated
Search now uses Fumadocs' search dialog backed by /api/search. Remove the
Algolia component, crawler config, sync and reindex workflows, env vars, and
the algoliasearch and react-instantsearch dependencies.
@sdserranog sdserranog changed the title Experiment: compare Algolia with Fumadocs built-in search Replace Algolia with Fumadocs built-in search Oct 21, 2026
Index URL slugs (and toolkit ids) as boosted keywords so "faq" and "on prem"
find pages whose titles use different words. Add a CDN Cache-Control header to
/api/search and a test for the main ranking cases.
- Show suggested pages while the search input is empty.
- Send PostHog events for settled searches and selected results, replacing the
  analytics lost with Algolia.
- Show Ctrl instead of the Mac command key on Windows and Linux, using
  Fumadocs' hotkey config.
- Cut /api/search queries to 200 characters instead of rejecting them.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 2121910. Configure here.

Comment thread components/search-dialog.tsx

This branch was successfully deployed

1 active deployment
Preview — 53971170 Deployed Oct 22, 2026 by vercel[bot]
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant