Right now, the Profiles option on the search page (https://publiclab.org/search/profiles/balloons/) is searching for users by username and bio.
In the endpoint, we would like to add the option to also search for user tags. Here we already have the parameter/value field=username, it is used when we want to search only by username. One option would be to add field=tag.
Hi @milaaraujo I would like to work on this issue
Hello Cess! We'd love your help.
@milaaraujo do you think on this one we may need to expand the search method in user.rb to include indexing tags somehow? I'm not totally sure how that'd work. Would it be a combined SQL query joining in the user_tags table ?
Perhaps it'd be a unique method like def self.search_by_tag(query) which would join in the user_tag table, or maybe something like:
def self.search_by_tag(query, limit: 25)
user_tags.where('value LIKE ?', query + '%')
.limit(limit)
User.find user_tags.collect(&:uid)
end
What do you think?
We'd probably want to write a test against this, similar to:
Hey guys, sorry for the delay but I took the last week off! I will answer you tonight!
Hey @jywarren, I would follow your second suggestion (a unique method like def self.search_by_tag(query))!
However, @stefannibrasil started working on #3501 and by my understanding her solution would address this issue here as well... Am I right, @stefannibrasil?
yes, I'll see if I can break into smaller tasks :)
Hey @cesswairimu, it will be difficult to break #3501 solution into smaller tasks for now...
Actually, I found a way to use your help, @cesswairimu! I am working on #3767. Once the endpoint is up to date we will need help to make the page (https://publiclab.org/search/profiles/) use the option tag.
Awesome @milaaraujo I am interested and will take a look when its merged. Thanks a lot
Just merged that change! Great!!
Re-opening:
Re-opening:
Most helpful comment
Hi @milaaraujo I would like to work on this issue