I'm looking for the optimal solution for keyword matching between different records in the database. It's a classic problem, I've found similar questions, but nothing concretely.
I've done it with full text searches, joins and subqueries, temp tables, ... so i'd really like to see how you guys are solving such a common problem.
So, let's say I have two tables; Products
and Keywords
and they are linked with the third table, Products_Keywords
in a classic many-to-many relationship.
If I show one Product
record on the page and would like to show top n related products, what would be the best option?
We should take into account that records might share several keywords and this fact should determine the ordering of the top related product.
I'm open for other ideas as well, but T-SQL would be preferable solution due to the performance reasons.