You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: FreshnessScorer defaults to current_year=2024, so this year's URLs score like undated ones #2426
As the docstring says, "more recent years score higher": with the default settings a URL dated this year scores highest.
Current Behavior
current_year defaults to a hard-coded 2024, and _extract_year discards any year later than current_year as invalid. So today, with the default:
a /2026/ or /2025/ URL scores 0.5, the same as a URL with no date
a /2024/ URL scores 1.0
BestFirstCrawlingStrategy with a default FreshnessScorer therefore ranks 2024 content above current content. The docs use it with the default (FreshnessScorer(weight=0.8)).
Fix: default current_year to None and use date.today().year; an explicit current_year keeps working as before. I'll open a PR against develop referencing this issue.
Investigated with AI assistance; I ran the reproduction and checked the output myself.
Activity