Planning my next mod; Related articles in sNews CMS
filed under: sNews CMS
OK, in playing around with MySQL's full text capabilities for an advanced search function I also thought about doing a "related posts" function along similar lines, like so many other blogs use, i.e. WordPress has several related posts type plugins. Today I have begun work on this monster of a mod, I've already been grinding out some tasty regular expressions and have much of the core MySQL full-text match code done.
I've always hated the way the typical related posts mod seems to just use basic tags/category matching, or a simple MySQL LIKE query, which results in much of the "related posts" not actually being such. Therefore I will use full-text matching and ranking of the keywords, which will be adjustable by the end user.
The beauty of full-text is speed and relevance, in my mod you will be able to increase relevance on certain items... i.e. rank higher any matches with the title or description words, then matches words from the body of the article against the other articles text at a lower ranking.
Done right, this will result in providing automatically generated related posts (that are actually related), and sorted by relevance. This is a beautiful thing, and using IN BOOLEAN MODE returns the match count (adjusted for ranking) in it's score, you can set a threshold, so if you only have 2 or 3 articles that are truly related, and just happen to have 5 or so similar words in an unrelated article, the unrelated article won't be displayed because it failed to meet that threshold.
There is no magic number, it will likely vary depending on ranking settings (obviously) but also the length of your articles, i.e. if your average article is only 50 words, you may need a lower threshold. I'm still tinkering to find the perfect score for me at the moment.
Once I've got it in good enough shape I will try it live on my site and then release it for public consumption.
Comments
No comments posted yet, why not be the first?
Categories
Recent Entries
Recent Comments
- Dede (I checked it today in a shop. GT2 had some troubles with six ...)
- Matt (Bintang, You need to re-direct the url, try ...)
- jesth (Ohh.. why didn't I think of that, thanks alot.)
- Matt (Dede, I don't have Gran Turismo 2, any of the 2nd+ generation ...)
- Matt (Jesth, Just change the if condition, instead of looking for ...)
- jesth (Hi (again) Was wondering, is it possible to make it ...)
- Bintang Sembilan (Matt, thanks for your modd. I have apply it to my ...)
- Dede (Hello there. Can you check something for me? I want to buy ...)
- Matt (I think it's a driver issue Terrence, or it was a driver issue. ...)
Popular Entries
- Light-weight related articles mod for sNews 1.7 (4.5/5)
- Image / math hybrid captcha version 2, vastly improved (4.42/5)
- 1024x600 netbook wallpapers of Evangeline Lilly (4.4/5)
- Compact archives for sNews 1.7 (4.4/5)
- sNews Ajax Polls mod now available (4.38/5)
- Pretty date and comments bars in sNews CMS (4.35/5)
- Page caching mod for sNews 1.7 (4.33/5)
- Gravatar mod for sNews 1.7 (4.29/5)
- An improved tag cloud for sNews 1.7 (4.29/5)