关于安装设置和基本编程请参见microsoft sql server 全文索引服务安装设置篇(http://www.chinaasp.com/faq/showfaq.asp?id=1234)和microsoft sql server 全文索引服务编程篇(http://www.chinaasp.com/faq/showfaq.asp?id=1235)。
sql 7的全文检索和index server的检索方式非常类似。
contains
and, or, not
可以在contains中很方便使用逻辑表达式
example:
select username from member where contains(userinfo,'"作家" and "木匠"')
select username from member where contains(userinfo,'"作家" or "木匠"')
select username from member where contains(userinfo,'"作家" and not "木匠"')
near
这是一个在普通的逻辑表达式中没有的关键字,意思是很简单,就是说找到靠近的两个词
example:
select content from microsoftrecord where contains(content,'"比尔·盖茨" near "保罗·艾伦"')
这就表示要找到全文中包含比尔·盖茨和保罗·艾伦,并且两个词相隔不远。
formsof inflectional
这个功能可以查找单词的各种形式,比如过去式、复数、动词形式、名词形式等。可惜对中文没什么用
example:
select productname from products where contains(productname,'formsof (inflectional, dry)')
*
这个功能可以查找单词的前缀,不过对中文也没有什么用处
example:
select productname from products where contains(productname, '"dis*"')
isabout weight
这个功能可以给复合查询时不同的条件以不同的权重,以决定返回的记录集的顺序
select categoryname, description from categories where contains(description, 'isabout spread weight (.8), sauces weight (.4), relishes weight (.2) )' )
权重的值可以从0.0到1.0
containstable
它的使用方式和contains基本相同,这里就不再重复介绍了。要提到的是它返回的是一张供你进一步查询的表,而不是一个查询条件。
freetext
如果使用这种方式,那么查询的时候会使用分词技术来实现模糊查询,并且过滤掉一些非关键词,比较类似于contains中的formsof,可惜对中文也没有什么支持
example:
select categoryname from categories where freetext (description, 'sweetest candy bread and dry meat' )
freetexttable
它和freetext的差别就跟contains和containstable的差别一样。
Java Asp PHP .Net XML C/C++ CGI VB Jsp J2ee J2se J2me EJB Servlet Tomcat Resin Struts Weblogic Eclipse ANT GUI JMS Web servise IDEA Webphere Hibernate Spring Jboss Applet Swing Socket Javamail Perl Ajax P2P 安全 模式 框架 测试 开源 游戏
Windows XP Windows 2000 Windows 2003 Windows Me Windows 9.x Linux UNIX 注册表 操作系统 服务器 应用服务器