Repository navigation
feat(popularity): aggregate page views from redirected URLs - #696
Merged
Merged
Conversation
Contributor
|
7ae9c94 was deployed to: https://rari-pr696.review.mdn.allizom.net/ |
caugner
marked this pull request as draft
May 15, 2026 15:07
caugner
commented
May 15, 2026
caugner
marked this pull request as ready for review
May 15, 2026 17:54
LeoMcA
requested changes
May 22, 2026
caugner
marked this pull request as draft
July 9, 2026 11:19
Aggregate page views from redirected URLs into each target page's popularity in built JSON and search-index order. Keep redirect-aware aggregation in the popularity module, normalize URLs consistently, and cover pages without redirect sources.
caugner
force-pushed
the
popularities-including-redirects
branch
from
September 24, 2026 16:39
9afe85c to
60cb317
Compare
caugner
marked this pull request as ready for review
September 24, 2026 16:43
LeoMcA
approved these changes
Oct 6, 2026
LeoMcA
left a comment
Member
There was a problem hiding this comment.
Looks good! We should apply these changes to the server as well:
Contributor
|
Build diff: 24797 changes in 1 of 14721 pages (0.0%) Download report ( |
This was referenced Oct 6, 2026
caugner
added this pull request to stack #983
October 6, 2026 22:30
This branch was successfully deployed
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.
Description
Aggregate popularity across redirects: a page's effective popularity is now its own page views plus the page views of every URL that redirects to it. Applied to both the per-page
popularityin built JSON and the ordering ofsearch-index.json.The development server uses the same aggregated popularity for search rankings.
Motivation
When a page is moved (e.g.
Web/Foo/bar→Web/Reference/Foo/Bar), pageview history attributed to the old URL inpopularities.jsonwas previously lost, making the moved page appear less popular than it actually is and ranking it lower in search.Additional details
REDIRECTS_REVERSED(lowercase target URL → source URLs) and apopularity_for(url)helper inrari-doc/src/popularity.rs.popularities.jsonkeys at load so the cross-lookup against the lowercase-keyedREDIRECTSmap is consistent._redirects.txtfiles contain no chains, so a single hop suffices.search-index.jsonis currently small: only 6 of 17.5k redirect sources appear inpopularities.json(the upstream feed is keyed by current canonical URLs). Top-100 ordering is unchanged; the 5 pages that move up are:/en-US/docs/Glossary/Style_sheet/en-US/docs/WebAssembly/Reference/Numeric/shr_s/en-US/docs/WebAssembly/Reference/Definitions/global/en-US/docs/WebAssembly/Reference/SIMD/load_store/load/en-US/docs/Learn_web_development/Core/Scripting