sql 2005 全文檢索

select * from dbo.EB_Admin_Company
where contains(china_full_name,'"蘇" or "苏州"')

select * from dbo.EB_Admin_Company
where contains(china_full_name,'苏州')

--位置相近
select * from dbo.EB_Admin_Company
where contains(eng_full_name,'"a" near "Ch*"')

--衍生字
select * from dbo.EB_Admin_Company
where contains(eng_full_name,'formsof (inflectional,flag)')

--给字串加权计分
select * from dbo.EB_Admin_Company
where contains(china_full_name,'isabout (苏州 weight(0.2),蘇 weight(0.4))')

--freetext
select * from dbo.EB_Admin_Company
where freetext(china_full_name,'苏州 蘇州')

--containstable
select *,a.* from dbo.EB_Admin_Company inner join
 containstable(china_full_name,' 苏州 or 蘇州 ')a on companyId=a.[key]
order by a.rank desc

--freetexttable
select *,a.* from dbo.EB_Admin_Company inner join
 freetexttable (china_full_name,eng_full_name,' 苏州  蘇州 ')a on companyId=a.[key]
order by a.rank desc

posted @ 2008-08-08 14:16  Nina  阅读(354)  评论(0编辑  收藏  举报