Skip to content

fix(docs): add the /api/search route behind the search dialog - #83

Merged
sapatmohit merged 1 commit into
mainfrom
fix/docs-search
Oct 21, 2026
Merged

sapatmohit merged 1 commit into
mainfrom
fix/docs-search

Conversation

@sapatmohit

@sapatmohit sapatmohit commented Oct 21, 2026 •

Copy link
Copy Markdown
Member

Description

The docs search dialog (⌘K) queries /api/search, but that route never existed, so every query returned 404 and search showed no results.

  • Adds src/app/api/search/route.ts, serving the index from the docs source via createFromSource. Results cover page titles, headings and body text.

Type of change

  • Bug fix
  • Documentation / website

Checklist

  • Dark mode / responsive styles considered (no UI change)
  • npm run lint passes
  • npm run typecheck passes
  • npm run test passes
  • npm run build passes
  • CI checks pass

Notes

Verified locally: switcher returns 25 hits, widget returns 12. The route is dynamic (ƒ /api/search).

Summary by CodeRabbit

  • New Features
    • Added documentation search support through a new search endpoint.
    • Search results are now powered by the documentation content source.

The Cmd+K dialog queries /api/search by default, but the route never
existed, so every query returned 404. Serve it from the docs source
with createFromSource.
@coderabbitai

coderabbitai Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: a2d572b2-0367-433f-878a-4186655c1bd5
📥 Commits

Reviewing files that changed from the base of the PR and between 2953bb0 and f1dff8c.

📒 Files selected for processing: 1
  • src/app/api/search/route.ts

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

📝 Walkthrough

The change adds a GET handler at /api/search. The handler uses Fumadocs createFromSource(source) to support the documentation search dialog.

Changes: Documentation Search

Layer / File(s) Summary
Search route integration
src/app/api/search/route.ts
Adds a GET handler backed by the Fumadocs documentation source. The comment identifies its use by the Cmd+K search dialog.

Priority: ➖ Normal

Estimated code review effort: 1 (Trivial) | ~5 minutes

Change: Bug fix

Merge Risk: ⚪ Minimal · up to f1dff

No actionable merge-blocking risk remains for this search-route change.

Pre-merge checks: Passed 5
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main change: adding the missing /api/search route for the documentation search dialog.
Docstring Coverage Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1 files.

✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Warning

Some tools did not complete. Review the errors below.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint install timed out. The project may have too many dependencies for the sandbox.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@sapatmohit
sapatmohit merged commit c919f6d into main Oct 21, 2026
2 checks passed
@sapatmohit
sapatmohit deleted the fix/docs-search branch October 21, 2026 06:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant