Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Archive /

Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo

How to retrieve related articles (Fulltext-search)


Go to End


2 Posts   2765 Views

Avatar
Fuzz10

Community Member, 791 Posts

19 July 2007 at 8:51pm

Edited: 19/07/2007 8:51pm

Hi all,

I'm currently trying to figure out a way to get related articles (related to the current article that is) from the database. Normally I would run a match-search on titles, descriptions and keywords (with the current title, description and keywords) and if that didn't produce any hits I'd run a mysql fulltext-search.

Can't seem to figure out how to go about implementing this in SS.

Would someone be so kind to point me in the right direction ? ;-)

Avatar
Fuzz10

Community Member, 791 Posts

20 July 2007 at 12:06am

Edited: 20/07/2007 12:08am

Kinda' Solved it.

There probably is a better way of doing it (by using the built in search engine for example) but I can't find any docs on it.

I didn't realize I could use Mysql's MATCH .. AGAINST in combination with data-objects.

So I ended up with :

DataObject::get("Page", "MATCH (Title, MenuTitle, Content, MetaTitle, MetaDescription, MetaKeywords) AGAINST ('$this->MetaKeywords')");