y` (`title`,`body`) WITH PARSER mysqlcft
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
INSERT INTO `mysqlcft_utf8`.`test` (`id`, `title`, `body`) VALUES (NULL, ''北京房价'', ''北京市统计局、国家统计局北京调查总队近日联合对外发布消息,今年以来,北京的商品房价格一直呈上升趋势,五环路以内住宅期房均价已涨至13754元/平方米。'');
INSERT INTO `mysqlcft_utf8`.`test` (`id`, `title`, `body`) VALUES (NULL, ''北京中心城区今起可无线宽带上网 奥运期间免费'', ''新浪科技讯 6月25日消息,北京无线城市一期网络今日起试运行,即日起北京市民和海外游客可以通过无线网络在北京中心城区接入互联网。'');
INSERT INTO `mysqlcft_utf8`.`test` (`id`, `title`, `body`) VALUES (NULL, ''数据库'', ''欢迎使用MySQL中文全文索引插件mysqlcft!'');
SELECT * FROM mysqlcft_utf8.test WHERE MATCH(title,body) AGAINST (''13754元/平方米'' IN BOOLEAN MODE);
SELECT * FROM mysqlcft_utf8.test WHERE MATCH(title,body) AGAINST (''6月25日'' IN BOOLEAN MODE);
SELECT * FROM mysqlcft_utf8.test WHERE MATCH(title,body) AGAINST (''北京'' IN BOOLEAN MODE);
SELECT * FROM mysqlcft_utf8.test WHERE MATCH(title,body) AGAINST (''北京 宽带'' IN BOOLEAN MODE);
SELECT * FROM mysqlcft_utf8.test WHERE MATCH(title,body) AGAINST (''mysqlcft'' IN BOOLEAN MODE);
SELECT * FROM mysqlcft_utf8.test WHERE MATCH(title,body) AGAINST (''数据'' IN BOOLEAN MODE);
3、以gbk字符集为例
CREATE DATABASE `mysqlcft_gbk` DEFAULT CHARACTER SET gbk;
USE `mysqlcft_gbk`;
CREATE TABLE `test` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`title` varchar(200) DEFAULT NULL,
`body` mediumtext,
PRIMARY KEY (`id`),
FULLTEXT KEY `title_body` (`title`,`body`) WITH PARSER mysqlcft
) ENGINE=MyISAM DEFAULT CHARSET=gbk;
INSERT INTO `mysqlcft_gbk`.`test` (`id`, `title`, `body`) VALUES (NULL, ''北京房价'', ''北京市统计局、国家统计局北京调查总队近日联合对外发布消息,今年以来,北京的商品房价格一直呈上升趋势,五环路以内住宅期房均价已涨至13754元/平方米。'');
INSERT INTO `mysqlcft_gbk`.`test` (`id`, `title`, `body`) VALUES (NULL, ''北京中心城区今起可无线宽带上网 奥运期间免费'', ''新浪科技讯 6月25日消息,北京无线城市一期网络今日起试运行,即日起北京市民和海外游客可以通过无线网络在北京中心城区接入互联网。'');
INSERT INTO `mysqlcft_gbk`.`test` (`id`, `title`, `body`) VALUES (NULL, ''数据库'', ''欢迎使用MySQL中文全文索引插件mysqlcft!'');
SELECT * FROM mysqlcft_gbk.test WHERE MATCH(title,body) AGAINST (''13754元/平方米'' IN BOOLEAN MODE);
SELECT * FROM mysqlcft_gbk.test WHERE MATCH(title,body) AGAINST (''6月25日'' IN BOOLEAN MODE);
SELECT * FROM mysqlcft_gbk.test WHERE MATCH(title,body) AGAINST (''北京'' IN BOOLEAN MODE);
SELECT * FROM mysqlcft_gbk.test WHERE MATCH(title,body) AGAINST (''北京 宽带'' IN BOOLEAN MODE);
SELECT * FROM mysqlcft_gbk.test WHERE MATCH(title,body) AGAINST (''mysqlcft'' IN BOOLEAN MODE);
SELECT * FROM mysqlcft_gbk.test WHERE MATCH(title,body) AGAINST (''数据'' IN BOOLEAN MODE);
八、性能测试报告
服务器:DELL PowerEdge 6850 (四颗双核Xeon 3.0GHz,8GB内存) 4U机架式服务器
操作系统:RedHat AS4 (x86_64位)
数据库:MySQL 5.1.25 RC + mysqlcft 1.0.0
数据表:超过80万条(807346