0

这是我的数据库代码。问题结果显示 0 而不是 1

  CREATE TABLE IF NOT EXISTS `house_details` (
   `houses_id` int(10) unsigned NOT NULL AUTO_INCREMENT,

   `everything_search` text NOT NULL

    FULLTEXT KEY `everything_search` (`everything_search`)
    ) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 


    INSERT INTO `house_details` (`everything_search`) VALUES
     ('Good very good new-market Mymenshing Family sourov 4564'),

这是我的数据库查询命令

SELECT * FROM house_details WHERE MATCH (everything_search) AGAINST ('Mymenshing') > 0   ORDER BY `houses_id` DESC LIMIT 0,3 

* and result is * MySQL 返回一个空的结果集(即零行)。(查询耗时 0.0013 秒)

4

2 回答 2

1

It works for me in boolean mode:

SELECT * FROM house_details WHERE MATCH (everything_search) 
AGAINST ('Mymenshing' In Boolean mode) > 0   ORDER BY `houses_id` DESC LIMIT 0,3

take a look here: http://www.sqlfiddle.com/#!2/d4471/6

after make some reasearch I found that there's a bug with the match-agains in Mysql: http://bugs.mysql.com/bug.php?id=19583

and here is how fix the 'stopwords': http://www.nivas.hr/blog/2009/09/15/how-to-disable-mysql-fulltext-stopwords/http://www.sqlfiddle.com/#!2/d4471/6

于 2012-11-09T15:35:09.280 回答
0

我认为您不需要>0where 子句:

        SELECT * FROM house_details 
        WHERE MATCH (everything_search) AGAINST ('Mymenshing')
        ORDER BY `houses_id` DESC LIMIT 0,3 ;
于 2012-11-09T14:16:05.900 回答