开发者

Fulltext search

I'm trying to get full text search working in Yii and I can't seem to find the issue.

I have the following SQL statement working correctly.

SELECT * FROM Topic WHERE MATCH(title,content) AGAINST ('testing' IN BOOLEAN MODE) LIMIT 11;

In Yii,开发者_如何学JAVA I'm using the following critieria that appears to be returning SELECT * FROM Topic LIMIT 11;


CDbcriteria Object
(
   [_paramCount:private] => 0
   [select] => *
   [distinct] =>
   [condition] =>
   [params] => Array
      (
      )

   [limit] => 11
   [offset] => 0
   [order] =>
   [group] =>
   [join] =>
   [having] =>
   [where] => Array
      (
         [0] => MATCH (title,content) AGAINST ('testing' IN BOOLEAN MODE)
      )
)

Any ideas where I've gone wrong?


I believe the fulltext search should be placed in "condition", not "where".

I usually use the function addCondition to accomplish this.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜