Skip to content

Migrate website search to Pagefind#27666

Open
MarioJGMsoft wants to merge 4 commits into
microsoft:mainfrom
MarioJGMsoft:mariojgmsoft-migrate-search-to-pagefind
Open

Migrate website search to Pagefind#27666
MarioJGMsoft wants to merge 4 commits into
microsoft:mainfrom
MarioJGMsoft:mariojgmsoft-migrate-search-to-pagefind

Conversation

@MarioJGMsoft

@MarioJGMsoft MarioJGMsoft commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Description

Replace the website's hosted search integration with a static Pagefind index so search works without deployment credentials and can be validated from a local production build.

The website build now generates the Pagefind index after Docusaurus, and a local SearchBar theme override renders Pagefind's accessible component UI. The Pagefind module loads after React hydration to ensure the live navbar trigger controls the active modal. This also removes obsolete search configuration and deployment variables, updates search styling and documentation, and adds end-to-end coverage for written docs, generated API docs, and search after client-side navigation.

For before and after view of the search in the website, see linked item.

Reviewer Guidance

The review process is outlined on this wiki page.

The post-hydration script loading in SearchBar is intentional; loading the custom elements before hydration can leave the visible trigger connected to a detached modal.

Known regressions / follow-up items

  • Tune relevance and version ranking. Queries such as SharedTree prioritize generated API references instead of the current quick-start content, while Fluid Framework ranks v1 pages first. Boost current conceptual documentation and demote generated or legacy content.
  • Reduce noisy and duplicate matches. Fluid Framework returns 1,198 matches instead of 133 and exposes many heading-level links. Scope indexing to primary content and tune which versions and headings are indexed.
  • Restore a shareable all-results view. The current search links to /search?q=...; the Pagefind modal has no URL-backed equivalent. Add a dedicated search route with query state.
  • Restore recent-search history. The current search persists and displays recent queries; the Pagefind modal does not. Add local query history or explicitly document that this feature will not be retained.

Validated with:

  • pnpm prettier
  • Targeted ESLint for the new SearchBar
  • npm run build
  • validateHashes.sh
  • npm run test (5 passed)

Fixes AB#77189

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Hi! Thank you for opening this PR. Want me to review it?

Based on the diff (395 lines, 12 files), I've queued these reviewers:

  • Correctness — logic errors, race conditions, lifecycle issues
  • Security — vulnerabilities, secret exposure, injection
  • API Compatibility — breaking changes, release tags, type design
  • Performance — algorithmic regressions, memory leaks
  • Testing — coverage gaps, hollow tests

How this works

  • Adjust the reviewer set by ticking/unticking boxes above. Reviewer toggles alone don't trigger anything.

  • Tick Start review below to dispatch the review fleet.

  • After review finishes, tick Start review again to request another run — it auto-resets after each dispatch.

  • This comment updates as new commits land; your reviewer selections are preserved.

  • Start review

@MarioJGMsoft MarioJGMsoft marked this pull request as ready for review July 10, 2026 17:10
Copilot AI review requested due to automatic review settings July 10, 2026 17:10

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot reviewed 9 out of 12 changed files in this pull request and generated no comments.

Files not reviewed (1)
  • website/pnpm-lock.yaml: Generated file

@WayneFerrao

Copy link
Copy Markdown
Contributor

Thanks for doing this! This is a huge step towards maintaining search while reducing overhead 🎉

A few thoughts:

Can you document details in the PR description on any regressions that this migration might add?
Does pagefind generate results from v1 and v2? Or do we lose versioning and are ok with that?
Does this search cover written docs as well as api docs? If so, add tests to cover all cases.

MarioJGMsoft and others added 2 commits July 10, 2026 13:26
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@MarioJGMsoft

MarioJGMsoft commented Jul 10, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for doing this! This is a huge step towards maintaining search while reducing overhead 🎉

A few thoughts:

Can you document details in the PR description on any regressions that this migration might add?
Does pagefind generate results from v1 and v2? Or do we lose versioning and are ok with that?
Does this search cover written docs as well as api docs? If so, add tests to cover all cases.

I updated the PR description with the regressions that we can do in follow up work.
The pagefind results are from both v1 and v2 docs. The issue here is that the v1 docs are shown first before the v2.
It does link both, API and Written docs, I can add the tests to confirm this.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
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.

3 participants