Repository navigation
feat(search): rebuild site search with ranked results and excerpts - #186
Merged
Merged
Conversation
Replace @cmfcmf/docusaurus-search-local with a local plugin (src/plugins/search). Index (build time) - One record per section of every rendered doc and changelog page, with the real heading anchors, breadcrumbs and code samples kept apart from the prose. - API reference: every operation of the OpenAPI specs in redoc.config.js (operationId, endpoint, summary, description), deep-linked to the Redoc anchor. The API reference was not searchable before. - Listings, redirects and pagination pages are left out. Ranking (browser) - BM25F over title, keys (operationId, endpoint, URL slug), context (page title, parent headings, breadcrumbs), body and code. - Query words match exactly, by word form (Porter stemming, weighted below exact), by prefix while typing, and by edit distance for typos. - Sections matching every word rank far above partial matches; title, page, phrase and proximity boosts; generated SDK/CLI reference pages and changelog entries rank below guides and the API reference. UI - Search dialog (Ctrl/Cmd+K or /) with results grouped by page, matched excerpts with highlighting, endpoint badges, filters for docs, API reference and changelog, and keyboard navigation. npm run test:search checks 67 queries against the built index. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CRtqyLatvXTimsB6sRCb8o
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Replaces
@cmfcmf/docusaurus-search-localwith a local search plugin insrc/plugins/search. The old search had no usable ranking and did not cover the API reference.What changed
Index (build time,
indexer.js)redoc.config.js(operationId, endpoint, summary, description), deep-linked to the Redoc anchor. About 1.5k operations; the API reference was not searchable before.data-search-ignore.Ranking (browser,
engine.js)UI (
theme/SearchBar)Ctrl/⌘ Kor/, results grouped by page, matched excerpt with highlighting per hit, endpoint badges for API operations.Verification
npm run test:searchruns 67 real queries against the built index (topics, questions, identifiers, endpoints, partial typing, typos). All pass.Notes for review
npm starthas no index of its own; it serves the one from the lastnpm run build.test:searchis not wired into CI: its expectations are tied to current page URLs, so a renamed page would fail unrelated docs PRs.cheerio,fs-extraandyamlare now declared as direct dependencies (they were transitive).yamlmoved 1.10.2 → 1.10.3 in the lockfile.i18n/en/code.jsonis removed: it only held a string of the old plugin.Generated by Claude Code