Data structure, best practice to build true "related by tags" items list? -
What do I mean "tags related to tags" list?
We think that there are 3 tags in the article (A, B), (A, C), (B, C) etc. A, B, C. / P>
Table: Tag
tag_ id tag_title tag_title
Table: Tag 2 article We can add a more table in which there is article_id and it is MD5 (A, B, C). Before hashing, we should sort the tags by the alphabet. Table: article_tags_hashed This table gives us the tag (A, B , C) will help find articles with the exact set, but it will not only help to find articles containing (A, B), (A, C), (B, C) most What is good practice? PS: Sorry for my english, it's too bad.
id article_id md5 count
I do not think you need article_tags_hashed because you have Tags2articles group the results for the query and can count.
Example:
Choose tag_id as tag_art tag (article_id) as tags in the tag_id where tag_id (...) tags by tag by article_id < / Code> / pre> Most tagged articles will be placed first.
Comments
Post a Comment