-
Notifications
You must be signed in to change notification settings - Fork 39
API for Discover hashtags #727
Comments
🍕 Client includes a single text field called API should be able to:
|
Thanks @vazquez. I made a few edits above, but your draft 🍕 tasted great. I will discuss this with @cadecairos and @simonwex next week. |
This design of tags from MakeAPI might be a useful input
|
@gvn - can you take a look at the short list above: #727 (comment) to see if this reflects a minimal spec for hashtags? MakeAPI might be a useful reference, but includes more complexity than we require. |
I had an idea how to implement this and ran with it: https://github.com/mozilla/api.webmaker.org/compare/develop...cadecairos:hashtags?expand=1 POC code here. Adds a description(varchar) and metadata (jsonb) field to projects. hashtags in description are captured and saved to metadata.tags. metadata.tags have an index that lets us do fancy shmancy queries, pretty quickly. This patch adds in migration code, and support for description/metadata to the create project route, and adds a IMO, getting this to a shippable state shouldn't take more than several days if this approach is acceptable. Just need to add support for description/metadata fields as required and write some tests. (edit: for server-side support. not front-end :)) |
That spec looks pretty good to me. 👍 @cadecairos A couple things:
General question to all: Are we going to try and allow non alphanumeric hash tags? (EG: Chinese characters? |
Thanks @cadecairos for diving into this. Good thinking @gvn on removing tags if that don't appear in an updated description. Re: non-alphanumeric characters - let's worry about that later, if we discover a demand. |
@gvn yeah, updating tags when description changes is easy, I just haven't done that part yet :) |
I added one more bit above #727 (comment). We should be able to query for hashtags flagged as featured (an admin can flag these manually). |
Cool. We agreed that tag extraction will be handled server side. "Featured" tags will initially be set up as an environment variable, delivered along with the current default Discover payload. It might include project metadata if it doesn't add too much overhead to reduce http hits and speed things up for users. @cadecairos will draft some example requests and responses for discussion. Anything else? |
https://gist.github.com/cadecairos/58e3509395342f8e2dfe Three ideas to kick around. |
I just left some comments in the gist... 👯 |
Cool. Dropped in some comments as well. |
I put a bit more work into this while on the plane to Mozfest. mozilla/api.webmaker.org@develop...cadecairos:hashtags The create/update project routes now accept description as a payload param, which is parsed into an array of tags that is saved into a jsonb column called "metadata" as There are two ways to search for tags: via I'm not sure if that second route should search for makes matching just one or all tags in the query, but it's a simple operator change. We could also include a flag that chooses the type of match operator dynamically. |
I think the second route should probably be projects matching any of the tags by default, but it might be nice to have a flag for matching all tags. However, off the top of my head I can't think of a good use case for matching all... |
I don't think we'll have a need for advanced search for multiple tags with and/or. Let's just focus on the first route for now. |
@cadecairos - let's discuss the status of this on our Tuesday stand. If you that time doesn't work for you, grab another time slot for you, me, @gvn, @alanmoo. |
@xmatthewx can I get an invite to that stand? |
11:30 eastern tomorrow. Not on your calendar? Oye. |
Moving along:
|
Note: we've reduced limit on description from 140 to 100 characters. |
thanks @cadecairos for the speedy work! |
hey @cadecairos - all of us south of the border have PTO the second half of this week. Ping us with any questions about tags before we vanish. It'd be great to run with this full speed when we return. |
Should I filter the tag suggestion results for bad words? Might be heavy handed to blacklist words from description and tags completely but suggesting "shit" when someone types "shi" (ship?) sounds undesireable |
Tag suggestions are not part of MVP. Let's get the basics up and running first. See how people use them before build out other bits. |
I already built that while waiting for code review, but I'll separate it out into a different patch, in case we need it later. |
Thanks @cadecairos - drop an update here when you're ready for @gvn to hook this up. |
@gvn - description api has landed on staging. check in with @cadecairos about pushing tags there too. tests are almost complete. Might be good to have that in staging for you while work is completed. |
Done and done. |
cc @vazquez
The text was updated successfully, but these errors were encountered: