MySQL全文搜索的问题# Database - 数据库
L*r
1 楼
在一段文本域中找同时出现的俩单词,发现website上介绍的办法
http://dev.mysql.com/doc/refman/5.0/en/fulltext-boolean.html
#
'+apple +juice'
Find rows that contain both words.
不灵
==============
mysql>SELECT id FROM reviews WHERE MATCH (data) AGAINST ('+apple +juice');
...........
...........
| 4715432 |
+---------+
1400 rows in set (2.22 sec)
mysql> SELECT * FROM reviews WHERE id=4715432;
+---------+--------------------------------+----+
| id | data | N1 |
+---------+--------------------------
http://dev.mysql.com/doc/refman/5.0/en/fulltext-boolean.html
#
'+apple +juice'
Find rows that contain both words.
不灵
==============
mysql>SELECT id FROM reviews WHERE MATCH (data) AGAINST ('+apple +juice');
...........
...........
| 4715432 |
+---------+
1400 rows in set (2.22 sec)
mysql> SELECT * FROM reviews WHERE id=4715432;
+---------+--------------------------------+----+
| id | data | N1 |
+---------+--------------------------