avatar
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 |
+---------+--------------------------
avatar
B*g
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');
: ...........
: ...........

avatar
a*s
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');
: ...........
: ...........

相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。