Best way to show similar content with C #

I work on a high-traffic site that offers news, photos and videos (among other things). One thing we are struggling with is the improvement of our “related items” module. If you are watching a video, we display a list of 5 related videos. This applies to blog posts, articles, etc. Our team marks w / keywords content well, and also associates it with the corresponding category and associates it with elements of other types of content, but no matter what mechanism we try, when displaying “related content”, it never approaches 100% exactly.

Are there any tried and true ways to get pretty accurate results based on tags, keywords, headings or categories? Our site is.net (C #) and uses SQL 2005. Let me know if you want me to clarify.

Thanks!

+4
source share
2 answers

It's already great that you use tags to categorize your products. This can be very powerful or very weak depending on the tags you use.

First of all: make sure you use meaningful tag names.

[Bad: C#1 , C#1.0 , Ruby1 , Ruby-1 , etc.]

[Good: C#1 , C#2 , C#3 , Ruby1 , Ruby2 , etc.]

Now you can create your GetRelatedItmesList method, which, of course, is Generic , and perform the checks.

For example, something like this:

 List<T> GetRelatedItemsList<T> (T item) where T : IOurMediaItem // I used an interface here because I like them :P - it can also be a class. { if (item.TagCount == 1) { // Get related items with the same tag and based on some keywords in title } else { // First: Get all items with exactly the tags // Second Get all items with relating title and append it to the list } } 

In any case, you can also do switch() in the item.TagCount property / method.

+1
source

Using tags is the easiest way to get this functionality, for example, if you display an article or video that has art, funny tags, you can download the 3 best videos from arts and entertainment on related videos.

I use tags because they are much more flexible, but use strict rules when tags are saved.

I hope this makes sense

0
source

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


All Articles