网站导航网学 原创论文 原创专题 网站设计 最新系统 原创论文 论文降重 发表论文 论文发表 UI设计定制 论文答辩PPT格式排版 期刊发表 论文专题
返回网学首页
网学原创论文
最新论文 推荐专题 热门论文 论文专题
当前位置: 网学 > 编程文档 > SQL SERVER > 正文

MySQL中文全文索引插件mysqlcft1.0.0安装使用文档

论文降重修改服务、格式排版等 获取论文 论文降重及排版 论文发表 相关服务
条)记录的表,字段“id”为int类型,主键;字段“title”为varchar类型,字段“body”为text类型。“title”和“body”分别建有INDEX普通单列索引、INDEX联合索引,FULLTEXT单字段全文索引、FULLTEXT联合全文索引。

  1、在字段“title”中搜索中文关键字:

SELECT * FROM database.table WHERE MATCH(title) AGAINST (''朝阳区'' IN BOOLEAN MODE) limit 0,30;
30 rows in set (0.04 sec)
SELECT * FROM database.table WHERE title LIKE ''%朝阳区%'' limit 0,30;
30 rows in set (6.56 sec)

SELECT * FROM database.table WHERE MATCH(title) AGAINST (''通州区'' IN BOOLEAN MODE) ORDER BY id DESC limit 0,30;
30 rows in set (0.13 sec)
SELECT * FROM database.table WHERE title LIKE ''%通州区%'' ORDER BY id DESC limit 0,30;
30 rows in set (8.15 sec)

SELECT * FROM database.table WHERE MATCH(title) AGAINST (''建国门外'' IN BOOLEAN MODE) ORDER BY id DESC limit 0,30;
30 rows in set (0.08 sec)
SELECT * FROM database.table WHERE title LIKE ''%建国门外%'' ORDER BY id DESC limit 0,30;
30 rows in set (5.34 sec)

SELECT * FROM database.table WHERE MATCH(title) AGAINST (''靠近通惠河'' IN BOOLEAN MODE) ORDER BY id DESC limit 0,30;
4 row in set (0.06 sec)
SELECT * FROM database.table WHERE title LIKE ''%靠近通惠河%'' ORDER BY id DESC limit 0,30;
4 row in set (12.88 sec)

  2、在字段“body”中搜索中文关键字:

SELECT * FROM database.table WHERE MATCH(body) AGAINST (''海淀区'' IN BOOLEAN MODE) ORDER BY id DESC limit 0,30;
30 rows in set (0.23 sec)
SELECT * FROM database.table WHERE body LIKE ''%海淀区%'' ORDER BY id DESC limit 0,30;
30 rows in set (15.71 sec)

SELECT * FROM database.table WHERE MATCH(body) AGAINST (''莱镇香格里'' IN BOOLEAN MODE) ORDER BY id DESC limit 0,30;
6 rows in set (0.18 sec)
SELECT * FROM database.table WHERE body LIKE ''%莱镇香格里%'' ORDER BY id DESC limit 0,30;
6 row in set (13.34 sec)

  3、在字段“title”和“body”中,搜索同时包含“西城区”和“商场”两个关键字的记录:

SELECT * FROM database.table WHERE MATCH(title,body) AGAINST (''西城区 商场'' IN BOOLEAN MODE) ORDER BY id DESC limit 0,30;
13 rows in set (0.27 sec)
SELECT * FROM database.table WHERE title LIKE ''%西城区%商场%'' AND body LIKE ''%西城区%商场%'' ORDER BY id DESC limit 0,30;
13 rows in set (51.74 sec)
设为首页 | 加入收藏 | 网学首页 | 原创论文 | 计算机原创
版权所有 网学网 [Myeducs.cn] 您电脑的分辨率是 像素
Copyright 2008-2020 myeducs.Cn www.myeducs.Cn All Rights Reserved 湘ICP备09003080号 常年法律顾问:王律师