在未做全文检索以前,个人主页只能对Fs_Title(文章标题)字段进行模糊查询(like'%*%'),如果对内容进行模糊查询,速度极慢,有时还可能报错,今天终于有空了,把这个查询做好了,经过测
试,检索一万条纪录不到两秒时间。ENJOY~~
复制代码 代码如下:
useLuanLuanDB
execsp_fulltext_database'enable'
execsp_fulltext_catalog'ArtileFullText','create','E:SearchPage'
execsp_fulltext_table'TArticle','create','ArtileFullText','PK_TArticle'
execsp_fulltext_column'TArticle','Fs_Title','add'
execsp_fulltext_column'TArticle','Fs_Content','add'
execsp_fulltext_table'TArticle','start_full'
测试代码:select*fromTArticlewhereContains(*,'"&key&"')andFi_IsShow='1'orderbyFi_IDDESC