日期:2014-05-18 浏览次数:20424 次
create index idx_c_content on tb(c_content)
------解决方案--------------------
-------------开启全文索引和创建全文索引目录 exec sp_fulltext_database 'enable' --exec sp_fulltext_catalog 'gf_ft','drop' exec sp_fulltext_catalog 'gf_ft','create' -------------为news表创建全文索引 可索引列为 title,abstract,text exec sp_fulltext_table 'product','create','gf_ft','pk_product' exec sp_fulltext_column 'product','productname','add' -------------激活索引 exec sp_fulltext_table 'product','activate' exec sp_fulltext_table 'product','start_full' --检查全文目录填充情况 While fulltextcatalogproperty('gf_ft','populateStatus')<>0 begin --如果全文目录正处于填充状态,则等待5秒后再检测一次 waitfor delay '0:0:5' END exec sp_fulltext_catalog 'gf_ft','start_full' --检查全文目录填充情况 While fulltextcatalogproperty('gf_ft','populateStatus')<>0 begin --如果全文目录正处于填充状态,则等待5秒后再检测一次 waitfor delay '0:0:5' END --------------测试------------------ SELECT * FROM product WHERE CONTAINS(productname,'一') -----------------------卸载------------------ EXEC sp_fulltext_table 'product','deactivate' exec sp_fulltext_column 'product', 'productname', 'drop' EXEC sp_fulltext_table 'product', 'drop' EXEC sp_fulltext_catalog 'gf_ft', 'stop' EXEC sp_fulltext_catalog 'gf_ft', 'drop'