想把一些文章的内容(文字比较多),保存到数据库,对其实现全文检索,应该如何实现,请大家多多指点。
谢谢!!
谢谢!!
解决方案 »
- 有一个问题困扰很久了.希望大虾能帮忙.想实现数据不写到ibdata1,而是写到相信的表中,就是.frm,但是不知道应该怎么弄,谢谢
- 求条sql语句
- InnoDb什么情况会运行运行着突然崩溃?或者调节什么参数能避免这种情况发生?
- 这句话是什么意思
- 关于MySQL在Linux中的问题
- 如何实现按这样要求随意拆分表格 mysql
- 如何在mysql的select语句中自动计数,急~~~
- 如何在 REPLACE 更新相同记录的时候 auto_increment 不增加……
- ems mysql manager问题
- mysql索引:where 语句,会自动先筛选有索引项的条件吗?
- mysql数据库关联问题
- 蔡鸟请教关于Postgres数据导入的问题,急~~~
MySQL has support for full-text indexing and searching: A full-text index in MySQL is an index of type FULLTEXT. Full-text indexes can be used only with MyISAM tables, and can be created only for CHAR, VARCHAR, or TEXT columns. A FULLTEXT index definition can be given in the CREATE TABLE statement when a table is created, or added later using ALTER TABLE or CREATE INDEX. 例子:
mysql> CREATE TABLE articles (
-> id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,
-> title VARCHAR(200),
-> body TEXT,
-> FULLTEXT (title,body)
-> );
Query OK, 0 rows affected (0.00 sec)mysql> INSERT INTO articles (title,body) VALUES
-> ('MySQL Tutorial','DBMS stands for DataBase ...'),
-> ('How To Use MySQL Well','After you went through a ...'),
-> ('Optimizing MySQL','In this tutorial we will show ...'),
-> ('1001 MySQL Tricks','1. Never run mysqld as root. 2. ...'),
-> ('MySQL vs. YourSQL','In the following database comparison ...'),
-> ('MySQL Security','When configured properly, MySQL ...');
Query OK, 6 rows affected (0.00 sec)
Records: 6 Duplicates: 0 Warnings: 0mysql> SELECT * FROM articles
-> WHERE MATCH (title,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)
1 楼的方法只是把全部文字建立了一个索引而已,很多索引的功能都没有
如果真要用全文检索的话,建议还是用sql server 2005
如果有能力,用lucene搭建一个检索模块最好