Skip to content

feat: faster search#167

Merged
dcrawbuck merged 11 commits intomainfrom
duncan/sw-5048-docs-improve-search-speed-and-quality
Apr 16, 2026
Merged

feat: faster search#167
dcrawbuck merged 11 commits intomainfrom
duncan/sw-5048-docs-improve-search-speed-and-quality

Conversation

@dcrawbuck
Copy link
Copy Markdown
Collaborator

@dcrawbuck dcrawbuck commented Apr 13, 2026

This switches production docs search to a prebuilt static FlexSearch index while keeping the API-backed path for development. It also adds SDK tag-aware indexing, reduces the search debounce, and generates the search bundle during normal and staging Cloudflare builds. The branch includes an end-to-end browser benchmark script that measures both API-backed and static-index search behavior against a supplied URL. Validation: bun test, bun run build:cf, and a local production-preview search smoke test.


Note

Medium Risk
Touches search indexing, ranking, and build/deploy steps (including Cloudflare staging), so regressions could impact docs search availability or result quality despite being isolated from auth/data-critical paths.

Overview
Switches production docs search from an API-backed query flow to a prebuilt static FlexSearch index generated at build time, while keeping the /api/search endpoint for development.

Adds build tooling (scripts/generate-search-index.ts) plus a client loader/cache (static-search-client.ts) and shared scope/tag logic (search.shared.ts), and updates the search UI to support scoped filtering, faster debouncing, idle-time index preloading, and an "Ask AI" action with keyboard shortcuts. Includes a new search-index implementation with export/import + ranking/highlighting behavior and accompanying tests.

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

@linear
Copy link
Copy Markdown

linear Bot commented Apr 13, 2026

@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented Apr 13, 2026

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
superwall-docs-staging bebda95 Commit Preview URL

Branch Preview URL
Apr 16 2026, 02:28 AM

Comment thread src/lib/search-index.ts
Comment thread src/lib/search-index.ts
Comment thread src/lib/search-index.ts
@dcrawbuck dcrawbuck changed the title SW-5048 Use static FlexSearch for docs search feat: better, faster search Apr 14, 2026
Comment thread scripts/search-benchmark.ts Outdated
Comment thread src/lib/search.shared.ts
Comment thread src/lib/search.shared.ts
@dcrawbuck dcrawbuck changed the title feat: better, faster search feat: faster search Apr 15, 2026
Comment thread package.json Outdated
Comment thread src/lib/search-index.ts
Comment thread src/lib/search-index.ts
Copy link
Copy Markdown

@cursor cursor Bot left a comment

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 and found 1 potential issue.

There are 2 total unresolved issues (including 1 from previous review).

Fix All in Cursor

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

Reviewed by Cursor Bugbot for commit bebda95. Configure here.

Comment thread src/components/SearchDialog.tsx
@dcrawbuck dcrawbuck merged commit c7e33a5 into main Apr 16, 2026
3 checks passed
@dcrawbuck dcrawbuck deleted the duncan/sw-5048-docs-improve-search-speed-and-quality branch April 16, 2026 02:57
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