views:

20

answers:

0

I have a scenario in which a C# program is going to provide a stored procedure with text, this is most probably going to be a table value where by each row is a line of text. I've found a way using dm_fts_parser to search this for keywords, the crux of which is based on something like:

WITH tab1 AS(SELECT 1 AS Id, N'Some search string' AS txt), 
     tab2 AS(SELECT 'search' as keyword) 
SELECT tab1.id,display_term, 
       COUNT(*) As cnt
FROM tab1
CROSS APPLY sys.dm_fts_parser('"' + REPLACE(txt,'"','""') + '"', 1033, 0,0)
JOIN tab2 t2 ON t2.keyword=display_term
WHERE TXT IS NOT NULL
GROUP BY tab1.id,display_term
ORDER BY Cnt DESC

Is it possible for me to adapt this such that I can obtain the ranking of the matches of the keyword in the text to be searched, or this not possible without creating full text indexes first?