Repository navigation
fix(search): stop zeroing the score of users with no followers - #1083
Merged
Merged
Conversation
…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>
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.
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