Skip to content

fix: rank exact matches above popularity factor - #142

Merged
vaxerski merged 1 commit into
hyprwm:mainfrom
ulascanzorer:fix/desktop-search-exact-match
Jun 3, 2026
Merged

fix: rank exact matches above popularity factor#142
vaxerski merged 1 commit into
hyprwm:mainfrom
ulascanzorer:fix/desktop-search-exact-match

Conversation

@ulascanzorer

Copy link
Copy Markdown
Contributor

Problem

When an exact name match exists, it is sometimes not the top result (see #138). The fuzzy score is base * lenFactor * popFactor, where match quality (base * lenFactor) is capped at 1.0 for an exact match, but popFactor = 1 + 0.08 * log1p(freq) is an unbounded multiplier. A frequently-launched partial match can therefore outrank a freshly-installed exact match.

Fix

Exact (case-insensitive, whole-string) matches now occupy a reserved score band above any achievable fuzzy score, so a popular partial match can no longer outrank them. Popularity still orders everything else, and still breaks ties among exact matches.

@vaxerski
vaxerski merged commit e07f9cd into hyprwm:main Jun 3, 2026
1 check passed
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.

2 participants