This repository was archived by the owner on Oct 27, 2026. It is now read-only.
Repository navigation
Demo: compare Algolia with Fumadocs built-in search - #1257
Draft
sdserranog wants to merge 2 commits into
Draft
sdserranog wants to merge 2 commits into
sdserranog wants to merge 2 commits into
Conversation
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.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Not for merge. This adds a test page so we can compare Algolia and Fumadocs' built-in search side by side.
Try it live: https://docs-git-exp-builtin-search-demo-arcade-ai.vercel.app/en/search-compare
Quick examples:
gmial,Gmail.SendEmail,on prem,cli.Question for the team
Once I tuned it, Fumadocs' built-in search did about as well as Algolia in my tests. Is there a reason to keep Algolia beyond the analytics, or should we try the built-in one?
Results from 62 queries (how often the right page comes up first):
Beyond the first result
Algolia's lists can look better in the screenshots, so I checked results 2 to 5 too. I took the top 5 from each engine for all 62 queries and had two separate sets of AI judges grade every page (useful, somewhat useful, or not useful) without knowing which engine it came from. The two sets agreed on 89% of pages.
Useful results in spots 2 to 5 (out of 4, average of both judges):
Comparing the whole top 5 query by query, the built-in list was better 23 to 25 times, Algolia's 19 times, and they tied 18 to 20 times.
So overall it's a tie. Algolia's later results are better for typos, and the built-in ones are better for integrations. Algolia still looks more precise because each result shows the section it matched (like "Gmail > Available tools"), and the judges only graded pages, so that isn't counted above. The built-in one's weak results also look more random, like Forkable for
gmial.Reasons to keep Algolia
clialso shows ClickUp)Reasons to try the built-in one
Gmail.SendEmailworkWhat's in this PR
lib/builtin-search.ts: built-in search setup (one result per page, title boost, English stemming, up to 2 typos, toolkit pages added)app/api/search/route.ts: the search endpointapp/en/search-compare/: the comparison page (hidden from search engines)The real search dialog still uses Algolia, so nothing changes for readers.
I wrote the queries myself. 22 of them were written after tuning so the settings weren't fitted to the test.
Note
Low Risk
Isolated demo page and new search API; no change to production search behavior, though
/api/searchcould add server load if widely used.Overview
Adds an experimental, noindex comparison page at
/en/search-compareso the same query can be run against Algolia (current docs search) and Fumadocs built-in search (ZBSearch) in parallel.A new
GET /api/searchroute wires uplib/builtin-search.ts, which builds indexes from MDX page structured data plus generated toolkit pages (tool names/descriptions from toolkit JSON), using simple mode with title boost, English stemming, and typo tolerance of 2.The
SearchCompareclient UI debounces input, syncs?q=in the URL, shows example queries, and displays timing, errors, and ranked results in two columns. The main site search dialog is unchanged and still uses Algolia.Reviewed by Cursor Bugbot for commit a1ac07c. Bugbot is set up for automated code reviews on this repo. Configure here.