Basically this is a database and query question. How do you implement related post in your site, suppose you have this table:
+------+ +------+
+ Post + + Tags +
-------- N : M --------
where post have the body and link m:n to tag. This is a very common scenario of implement tag and post.
so, How do you implement related post in your site?
Find all the posts which overlap on at least one tag and use term frequency - inverse document frequency to weight the tags by importance, and sum the weights. Return related posts in descending order of total weight.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With