"Related articles" (php+mysql)
Does anyone have suggestions for how I can do a "Related" articles type of thing?
I have the title and body stored in separate columns in the database.
Can anyone suggest ideas to help me brainstorm?
SonicMailer Pro
The best mailing list manager has just gotten better!
Click here for a full list of features!
Abhishek Reddy posted this at 02:42 — 6th August 2004.
He has: 3,348 posts
Joined: Jul 2001
Sure, this is something I've wondered for a while too. I don't have answers but I have some ideas.
The two main ways I figure are to provide meta data yourself, or have the machine 'analyse' content and extract meta information.
One simple way would be to have a 'keywords' field for each article. List articles with similar keywords. On top of that, you could order the keywords by relevance, so that to view related articles, similar articles are filtered not only by the presence of keywords, but by their weight in similarity of order.
Another way is to count frequency of keywords in an article -- excluding a list of known words like 'the' and 'and'. Other articles with high frequencies of the top keywords in the selected article may be relevant.
Further, you could consider the geography of keywords. You could award more weight points to keywords located in, say, the top 25% of the article, and less to keywords in code blocks and examples.
Ultimately, I suppose you end up with a 'keywords' field that you try and match to. Beyond that, you might apply constraints for age, popularity, length/size and so on.
I'm not aware of any other methods, but I haven't formally studied this either.
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.