Fetch 20 search results a page instead of 30 - #3428
Merged
Merged
Conversation
Each row in a page costs a fragment fetch, so the page size is what a search pays before it can draw anything. Twenty still gives byNameThenDepth enough of the list to reorder, and a reader who has scrolled past twenty rows is better served by a narrower query. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
Pull request environment is available at https://stoctodocspr3428.z22.web.core.windows.net. You can view the ephemeral environment status in Octopus Deploy. This environment will be automatically deprovisioned when the pull request is closed, or after 7 days of inactivity. |
borland
approved these changes
Aug 30, 2026
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.
Each row the search overlay draws costs a fragment fetch, so
PAGE_SIZEis what a query pays before it can show anything. Dropping it from 30 to 20 cuts that by a third.Twenty still leaves
byNameThenDepthenough of the list to reorder, and the shallow-page promotion that rescues a page ranked past the page size is untouched. Two comments that quoted the old number are corrected.Pagefind is left alone. This is the cheap part of the search speed-up, split out from #3408 so it can land on its own.
All 30 tests in
tests/docs-search.spec.tspass, including the three that depend on the page size: "scrolling to the end of the results loads more", "a page pulled forward is not listed again further down", and "the page a query names comes first".🤖 Generated with Claude Code