Friday, December 7, 2007

Query full text table with RANKING

--Full text search query
select * from <FullTexed table name> O, CONTAINSTABLE(<FullTexed table name>, <FullTexed table column of your table>, '<search word>') AS K
WHERE K.[KEY] = O.<primary key of the table>
ORDER BY K.RANK DESC

Example:
select * from organisation O, CONTAINSTABLE(Organisation, Description, 'internet OR intranet') AS K
WHERE K.[KEY] = O.OrganisationID
ORDER BY K.RANK DESC

No comments: