MATCH - AGAINST in CakePHP

723 views Asked by At

I am new in CakePHP and now I can't transform the query:

SELECT *, 
MATCH (title, post, tags) AGAINST ('dialux' IN BOOLEAN MODE) as REL
FROM posts 
WHERE MATCH (title, post, tags) AGAINST ('dialux' IN BOOLEAN MODE)
ORDER BY REL DESC;

in something like this:

$this->Post->find('all', xxx);

Any ideas? Thanks.

1

There are 1 answers

0
Josh Waller On

Not sure if this is helpful as it is from the page that has already been suggested by mark

But you could try something like this:

$query = 'SELECT *, 
MATCH (title, post, tags) AGAINST ('dialux' IN BOOLEAN MODE) as REL
FROM posts 
WHERE MATCH (title, post, tags) AGAINST ('dialux' IN BOOLEAN MODE)
ORDER BY REL DESC;';

$this->Post->query($query);