Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

most efficient way to do taging system 1

Status
Not open for further replies.

snowboardr

Programmer
Feb 22, 2002
1,401
PH
What would be the most efficient way to do a word tagging system kind of like del.icio.us ... I am using MySQL database...
 

do you mean as in keywords related to your article/blog/whatever ?

If so,..
Depends on the method of input - will you be entering the keywords manually (e.g. a text box to enter the list of tags to file under), or do you want to derive the tags from the words within the text ? The latter is really more about indexing for searching, but you can use this to implicitly organise into tags.

Taking the more likely former method (entered manually), then you can:

1. Add a text box to your form for tags to be entered. If you use something like a comma or semi-colon to separate them you can have multiple tags (with spaces) for each article.
2. When it is posted you want to split the list and add them to a table listing the keywords against the id of the article e.g.: tag_name | article_id
3. When presenting the tags for user selection (e.g. a tag cloud) select from this table of tags and group by the tag_name and do a count: e.g.: unique_tag_name | count_of_tags (to give you the size/popluarity of the tag)
4. When the user selects a tag, join the tag table where the tag is the one they want with the article table where the ids are the same. Then present your list of articles.

The same principles apply to the full indexing method, though with that you need to group keywords before insertion and count the occurences etc - you also need to filter out the 'noise' - words like "I", "or", "and", "the" etc.

Hope that helps.

A smile is worth a thousand kind words. So smile, it's easy! :)
 
Thanks that helps alot... I understand how to pull it off now... its basicly going to be for Q & A... people can tag them so they can return the Q & A Later... I have heard a ton about indexing, but never really had to do it with the clients that I have worked with when I was a web developer, however now I am doing a slightly larger project on my own, so I am going to have to do that with this taging system like you said... do you know how i index in MySQL? ... I'll have to admit i never had to look into indexes because I only worked on smaller company sites... so i am a newbie on that one.


Jason
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top