I want to use SQL Server 2005 Express to find the top five tuples related to a paragraph of text. I know I can use Full Text Indexing and CONTAINSTABLE to find rows that contain an exact phrase, but how do I get it to return the closest matches to the words in a paragraph, not the exact paragraph itself.
So far the only way I can think of is to split the CONTAINSTABLE query, inserting ' or ' for every space character, generating a query along the lines of the following, but am concerned about performance (and stop words).
SELECT id, FT.rank, description
FROM SearchTable
INNER JOIN CONTAINSTABLE (SearchTable, *,
'"This" OR "is" OR "my" OR "paragraph"') AS FT
ON SearchTable.id = FT.[key]
ORDER BY Rank DESC
I expect there's a standard solution to this problem - does anyone know what it is?