Looking for the most optimal way to create a hashtag type functionality like Twitter:

I’m still trying to conceptualize what’s the best way to create a hashtag functionality on my website. I have detailed below what I am thinking and could use your opinion/ guidance to see if this is the best way and how exactly to go about it.

Use case 1:
User is trying to enter a post and the moment he uses the “#”, it should display the list of hashtags that other users have already posted. For example “#mo” could show #modelx, #model3 in dropdown.

The way I am thinking of going about this is, everytime a user creates a post, extract all the hashtags using regex function and store this in a separate table which contains 2 fields : “list of postids”, hashtag.
If there is a hashtag that user has used which already exists in the table, append the postid to list of post ids. Otherwise, create a new record.
If a user has five different hashtags on the post and none of them currently exist in the table, it’d create 5 different records with the same postid for each hashtag.

I can then use the tagger plugin to display the relevant hashtags if applicable while the user is writing a post.
*note: I don’t know how to go about segregating the hashtags and store them in different rows in the table. But I am guessing this should be possible with bubble and shouldn’t be complicated once I extract the hashtags with regex.

Use case 2:
Users should be able to click on the hashtag and the system should display all the relevant hashtags

I am not sure on how to go about this. How can you make the hashtags clickable within the textfield and set up a workflow based on that?

Also, as the number of posts and hashtags increases, would this lead to severe performance issues considering you are searching for the huge amount of records within the table? Any help on this and how to go about this would be greatly appreciated

1 Like

This topic was automatically closed after 70 days. New replies are no longer allowed.