Skip to content

fix(search): stop zeroing the score of users with no followers - #1083

Merged
dylanjeffers merged 1 commit into
mainfrom
fix/user-search-zero-followers
Nov 13, 2026
Merged

dylanjeffers merged 1 commit into
mainfrom
fix/user-search-zero-followers

Conversation

@dylanjeffers

Copy link
Copy Markdown
Contributor

Searching `abasin` never returns the user with handle `abasin` (0 followers), not even in the top 100. Michael could not find him to add as a collaborator.

Cause

The function score multiplies the text score by the raw `follower_count` (`field_value_factor`, multiply mode). Zero followers means a score of 0, below every fuzzy match, and the exact-handle boost is multiplied away too. Tracks and playlists have the same problem with `repost_count`.

Change

Scale by count + 1 in both the user query and the shared helper. Ranking among results with a non-zero count is effectively unchanged.

Testing

New case in `TestSearch`: an exact handle match with no followers ranks above a longer handle that has a follower. Fails on main, passes here.

🤖 Generated with Claude Code

…owers or reposts

The popularity factor multiplied the text score by the raw count, so an
artist with 0 followers scored 0 and sorted below every fuzzy match, even
on an exact handle match. Scale by count+1 instead.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@dylanjeffers
dylanjeffers merged commit d9c80f9 into main Nov 13, 2026
2 checks passed
@dylanjeffers
dylanjeffers deleted the fix/user-search-zero-followers branch November 13, 2026 19:34
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.

1 participant