-
-
Notifications
You must be signed in to change notification settings - Fork 207
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
added public_name search function #2164
base: master
Are you sure you want to change the base?
Conversation
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.
I think it's probably better to have a single query and unified results section for both usernames and public names.
Also, a new trigram index is needed on the public_name
column to speed up the search:
CREATE INDEX public_name_trgm_idx ON participants
USING GIN (lower(public_name) gin_trgm_ops)
WHERE status = 'active'
AND public_name IS NOT null;
Should we include the username and public name under the avatar on all search results from now on? I think it would help with any confusion if an account has a similar username and public name. |
Yes, both names should be displayed for all results. |
I've made it so the username and public name are returned in a single query, and both are displayed. I also added the index. I'm not sure what word to use instead of "username" now. For example in the phrasing "Found a matching username". I was thinking of just using "user", but maybe "individual" would be more consistent. |
Co-authored-by: Charly C. <changaco@changaco.oy.lc>
Co-authored-by: Charly C. <changaco@changaco.oy.lc>
thanks for the suggestions. I just wanted to check, the tests will have to be updated for this, right? It looks like two are failing now. |
The tests aren't failing with the latest commit. I think GitHub is still showing earlier test results because there's currently a merge conflict (because #2177 hasn't been deployed yet, because I've been waiting for new machine and human translations (liberapay/salon#520)). |
closes #2082
I basically mimicked the structure of the code for usernames, but pointed the new query to the
public_name
column of theparticipants
table, it seems to work fine.