mysql全文索引的坑_MySQL全文索引问题

我有一个包含以下数据的表格文章

mysql> select * from articles;

+----+-----------------------+------------------------------------------+

| id | title | body |

+----+-----------------------+------------------------------------------+

| 1 | MySQL Tutorial | DBMS stands for DataBase ... |

| 2 | How To Use MySQL Well | After you went through a ... |

| 3 | Optimizing MySQL | In this tutorial we will show ... |

| 4 | 1001 MySQL Tricks | 1. Never run mysqld as root. 2. ... |

| 5 | MySQL vs. YourSQL | In the following database comparison ... |

| 6 | MySQL Security | When configured properly, MySQL ... |

| 7 | ABCD | Following things are not upto date |

| 8 | RockOn | is the Following |

+----+-----------------------+------------------------------------------+

8 rows in set (0.00 sec)

当我把查询写成..

mysql> select * from articles where match(`body`) against('database');

+----+-------------------+------------------------------------------+

| id | title | body |

+----+-------------------+------------------------------------------+

| 5 | MySQL vs. YourSQL | In the following database comparison ... |

| 1 | MySQL Tutorial | DBMS stands for DataBase ... |

+----+-------------------+------------------------------------------+

2 rows in set (0.00 sec)

结果如预期.

但是当我发出查询时

mysql >select * from articles where match(`body`) against('following' in boolean mode);

Empty set (0.00 sec)

为什么它显示空集,因为有对应于查询的记录.

我身上有全文索引.

mysql> show create table articles\G

*************************** 1. row ***************************

Table: articles

Create Table: CREATE TABLE `articles` (

`id` int(10) unsigned NOT NULL AUTO_INCREMENT,

`title` varchar(200) DEFAULT NULL,

`body` text,

PRIMARY KEY (`id`),

FULLTEXT KEY `body` (`body`)

) ENGINE=MyISAM AUTO_INCREMENT=9 DEFAULT CHARSET=latin1

1 row in set (0.00 sec)

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值