New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix account search not returning followed accounts first #22956
Conversation
This makes it so that (when elasticsearch is disabled) when a user types '@foo' in the compose box, they are first going to get accounts they follow ordered by the ranking algorithm, and then second they will get accounts they do not follow, also ordered by the ranking algorithm. This makes behavior more consistent with user expectation and also with results when elasticsearch is enabled.
Please! Users are extremely unlikely to compose a new post to a random person with lots of followers rather than someone they follow. |
Also, I am not sure why there are linter errors happening here. They apply to lines of code I did not touch and that are the same as what I see in the currently-passing |
What about the join two lines up? |
@Gargron What about it? |
This is a good idea as a feature, and the code seems credible. I wonder about the efficiency of the subselect. A subselect is not optimizable. Given a relatively trivial look at the query, I can imagine an approach that modifies the |
to be clear, before mastodon 4.0, followed accounts were returned first. The change to algorithm-only for search-disabled instances is new in 4. |
I updated the SQL and it is much improved. No nasty extra JOIN. Thanks @Gargron for the pointer |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the record this is a regression in 4.0. The described behaviour has already existed in Mastodon.
) * Make autosuggest for mentions return followed accounts first This makes it so that (when elasticsearch is disabled) when a user types '@foo' in the compose box, they are first going to get accounts they follow ordered by the ranking algorithm, and then second they will get accounts they do not follow, also ordered by the ranking algorithm. This makes behavior more consistent with user expectation and also with results when elasticsearch is enabled. * Fix ranking order to correct direction * One more fixup per @Gargron suggestion * Tweak to ranking to no longer include following modifier
This makes it so that (when elasticsearch is disabled) when a user types
@foo
in the compose box, they are first going to get accounts they follow ordered by the usual ranking algorithm, and then second they will get accounts they do not follow, also ordered by the ranking algorithm.This makes behavior more consistent with user expectation and also with results when elasticsearch is enabled.