欢迎光临
我们一直在努力

如何在SQL中启用全文检索功能?(实例)-数据库专栏,SQL Server

建站超值云服务器,限时71元/月

如何在sql中启用全文检索功能?

——————————————————————————–
 
全文索引的一个例子,在查询分析器中使用:
use pubs
go
–打开数据库全文索引的支持
execute sp_fulltext_database enable
go
–建立全文目录ft_titles
execute sp_fulltext_catalog ft_titles, create
go
–为titles表建立全文索引数据元,upkcl_titleidind是主键所建立的唯一索引,可由sp_help titles得知
execute sp_fulltext_table titles,create, ft_titles, upkcl_titleidind
go
–设置全文索引列名
exec sp_fulltext_column titles, title, add
go
exec sp_fulltext_column titles, notes, add
go
–建立全文索引
exec sp_fulltext_table titles, activate
go
–填充全文索引目录
exec sp_fulltext_catalog ft_titles, start_full
go
–使用contains和freetext
select title, notes from titles
where contains(title, “computer cooking”)
go
select title, notes from titles
where freetext(title, computer cooking)
go
select title, notes from titles
where freetext(title, “computer cooking”)
go
select title, notes from titles
where contains(title, computer)
go
select title, notes from titles
where freetext (*, computer)
go
 

赞(0)
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com 特别注意:本站所有转载文章言论不代表本站观点! 本站所提供的图片等素材,版权归原作者所有,如需使用,请与原作者联系。未经允许不得转载:IDC资讯中心 » 如何在SQL中启用全文检索功能?(实例)-数据库专栏,SQL Server
分享到: 更多 (0)

相关推荐

  • 暂无文章