What is the best algorithm for finding related mail?

This is mainly a question with a database and queries. How to implement the corresponding entry on your site, suppose you have this table:

+------+ +------+ + Post + + Tags + -------- N : M -------- 

where the message has a body and an m: n link for the tag. This is a very common script and tag implementation scenario.

So how do you implement a related post on your site?

+4
source share
1 answer

Find all messages that overlap with at least one tag and use the term frequency - the inverse frequency of the document , so that the weight of the tags in importance and the sum of the weight. Messages returned in descending order of total weight.

+8
source

Source: https://habr.com/ru/post/1300900/


All Articles