Skip to content

feat(website): improve search by filtering JS API docs and release notes#10764

Draft
timotheeguerin wants to merge 1 commit into
microsoft:mainfrom
timotheeguerin:better-web-search
Draft

feat(website): improve search by filtering JS API docs and release notes#10764
timotheeguerin wants to merge 1 commit into
microsoft:mainfrom
timotheeguerin:better-web-search

Conversation

@timotheeguerin
Copy link
Copy Markdown
Member

Problem

The website search (Algolia DocSearch) returns excessive noise:

  • 909 out of 1066 docs (85%) are JS API reference pages — these dominate results
  • Release notes produce many matches for any term mentioned across versions
  • Sidebar navigation labels get indexed into result titles, creating absurdly long concatenated breadcrumbs

Changes

1. Fix long concatenated titles

  • Added data-docsearch-ignore to the sidebar component so the crawler skips it when building the search index

2. Filter JS API & release notes from default search

  • Added transformSearchClient + transformItems to filter results whose URL contains /reference/js-api/ or /release-notes/
  • Use $ prefix (e.g., $tagMetadata) to search all content including JS API and release notes
  • Updated search placeholder to Search… ($ for all)

3. Prepare for server-side filtering (future)

  • Added Head.astro override that injects <meta name="docsearch:tag" content="docs|js-api|release-notes"> based on page frontmatter
  • Once the crawler re-indexes, this enables server-side tagFilters for more efficient filtering

Testing

  • Search tagMetadata → should show only decorator/guide docs
  • Search $tagMetadata → should show all results including JS API and release notes
  • Inspect page HTML to verify <meta name="docsearch:tag"> is present

- Add data-docsearch-ignore to sidebar to prevent crawler from indexing
  sidebar labels into search result titles (fixes long concatenated titles)
- Filter out JS API and release notes from default search results using
  transformItems client-side filtering
- Add $ prefix support to search all content including JS API and release notes
- Add Head.astro override to inject docsearch:tag meta for future server-side filtering
- Update search placeholder to hint at $ prefix
@microsoft-github-policy-service microsoft-github-policy-service Bot added the meta:website TypeSpec.io updates label May 21, 2026
@github-actions
Copy link
Copy Markdown
Contributor

No changes needing a change description found.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

meta:website TypeSpec.io updates

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant