Skip to content

Docs search improvement#3179

Merged
reynaldichernando merged 4 commits into
HeyPuter:mainfrom
reynaldichernando:search-improvement
May 28, 2026
Merged

Docs search improvement#3179
reynaldichernando merged 4 commits into
HeyPuter:mainfrom
reynaldichernando:search-improvement

Conversation

@reynaldichernando
Copy link
Copy Markdown
Member

@reynaldichernando reynaldichernando commented May 28, 2026

fixes #2362

  • use subheading section match instead of entire page match
  • update UI to show if inside subheading
  • use minisearch for fuzzy
  • update from building manual search index to using minisearch index

notes:

  • there's some specific logic for the minisearch tokenizer
  • and this is mostly based on vibes, to for user to search easier, like "aichat"
  • basically improving on top of what minisearch fuzzy provides
  • also with this subheading match, we are also improving our text fragment matching success rate

@reynaldichernando
Copy link
Copy Markdown
Member Author

bruh

@reynaldichernando
Copy link
Copy Markdown
Member Author

😎

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR improves the docs site search by moving from manual page-wide substring matching to a MiniSearch-backed index with fuzzy/prefix matching and section-aware results (including section anchors and optional text-fragment navigation).

Changes:

  • Replace client-side linear search with MiniSearch (fuzzy + prefix + AND-combined terms) and updated result rendering (Page Title › Section).
  • Change search indexing in build.js from whole-page plain text to per-section documents and serialize as a MiniSearch index (toJSON()).
  • Add minimal UI styling for the new “Page Title › Section” result format and include minisearch as a dependency.

Reviewed changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/docs/src/assets/js/search.js Loads a serialized MiniSearch index, performs fuzzy/prefix searches, and builds anchor/text-fragment result URLs with updated UI rendering.
src/docs/build.js Builds a section-based docs corpus and outputs a serialized MiniSearch index for the frontend to load.
src/docs/src/assets/css/style.css Adds styling for page-title prefix and separator in search results.
src/docs/package.json Adds minisearch dependency for docs build + frontend bundle.
package-lock.json Locks the new dependency and associated lockfile changes.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +188 to +189
// Index hasn't finished loading yet; show empty state.
updateSearchResults([]);
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

probably a good idea for an issue

Comment thread src/docs/build.js
@reynaldichernando reynaldichernando merged commit 1121314 into HeyPuter:main May 28, 2026
3 checks passed
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.

Docs search improvement

2 participants