|
|
|
|
|
|
L******r 发帖数: 199 | 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 |
+---------+-------------------------- | B*****g 发帖数: 34098 | 2 don't know much about mysql.
but when I do oracle/.net/others, if I copy the code from reliable source
not work in my environment, the first thing I do is check the version diff.
For your case, make sure you use mysql 5.0
【在 L******r 的大作中提到】 : 在一段文本域中找同时出现的俩单词,发现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'); : ........... : ...........
| a*******s 发帖数: 324 | 3 It seems fulltext index introduced in MySQL 5.0 and can only be used for
myisam type table.
At least, you should add the fulltext index when you create the table.
【在 L******r 的大作中提到】 : 在一段文本域中找同时出现的俩单词,发现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'); : ........... : ...........
|
|
|
|
|
|