匹配 - 在CakePHP中反对

时间:2014-11-23 13:47:34

标签: php sql cakephp match-against

我是CakePHP的新手,现在我无法转换查询:

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->find('all', xxx);

有什么想法吗?感谢。

1 个答案:

答案 0 :(得分:0)

不确定这是否有用,因为它来自mark已建议的网页

但你可以尝试这样的事情:

$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);