开发者

Fulltext search

开发者 https://www.devze.com 2023-03-12 11:31 出处:网络
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.

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

精彩评论

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