SQL Server 2005 全文检索
2007-03-24 13:01
288 查看
首先确认安装了全文检索组件和服务,主要是Express版本,它默认是不安装的,企业版和开发版默认是安装的
1、允许数据库使用全文索引,
在SQL Server Management Studio中选择要操作的数据库的右键菜单中的属性,在属性窗口中的Files页面,有Use full-text indexing,勾选这个复选框就可以了。
create fulltext catalog catalogname
运行完此命令,会在sql的安装目录下产生一个缓存文件夹:
create unique index indexname on talbename(columnname)
4、创建全文索引
根据之前的full-text catalog和unique index在同一表上创建全文索引
create fulltext index on tablename(column1,colunmn2,)
key index indexname on catalogname
with change_tracking auto
5、使用全文检索函数contains,
完成上面的一系列工作后,就可以在查询中使用全文索引函数contains
where contains(column, '"a" and "b" not "c"')
where contains(column, '"abc"')
where contains(column, '"a" and "b" and "c"')
where contains(column, '"a" near "b"')
where contains(column, 'formsof(inflectional, "happy")')
matches "happy", "happier", "happiest", "happily".
contains(column, 'isabout("computer" weight(0.5), "software" weight(2.0),
"development" weight(10.0)) rankmethod inner product')
1、允许数据库使用全文索引,
在SQL Server Management Studio中选择要操作的数据库的右键菜单中的属性,在属性窗口中的Files页面,有Use full-text indexing,勾选这个复选框就可以了。
create fulltext catalog catalogname
运行完此命令,会在sql的安装目录下产生一个缓存文件夹:
create unique index indexname on talbename(columnname)
4、创建全文索引
根据之前的full-text catalog和unique index在同一表上创建全文索引
create fulltext index on tablename(column1,colunmn2,)
key index indexname on catalogname
with change_tracking auto
5、使用全文检索函数contains,
完成上面的一系列工作后,就可以在查询中使用全文索引函数contains
where contains(column, '"a" and "b" not "c"')
where contains(column, '"abc"')
where contains(column, '"a" and "b" and "c"')
where contains(column, '"a" near "b"')
where contains(column, 'formsof(inflectional, "happy")')
matches "happy", "happier", "happiest", "happily".
contains(column, 'isabout("computer" weight(0.5), "software" weight(2.0),
"development" weight(10.0)) rankmethod inner product')
相关文章推荐
- SQL Server 2005 全文检索
- SQL Server 2005全文检索技术
- SQL Server 2005全文检索技术在网站上的应用实录
- SQL Server 2005 全文检索
- SQL Server 2005全文检索技术
- SQL Server 2005全文检索技术在网站上的应用实录
- Sql Server 2005全文检索中碰到的问题和分析
- SQL Server 2005全文检索技术
- SQL Server 2005全文检索技术
- SQL Server 2005 中如何做全文检索
- SQL Server 2005 中如何做全文检索
- SQL Server 2005全文检索技术在网站上的应用实录 索引
- SQL Server 2005全文检索技术
- SQL Server 2005全文检索技术
- SQL Server 2005全文检索技术在网站上的应用实录
- SQL Server 2005 与全文检索
- SQL Server 2005全文检索技术在网站上的应用实录(一)
- SQL Server 2005 全文检索
- SQL Server 2005全文检索技术
- SQL Server 2005全文检索技术