I'm performing semantics analysis on 1000 docs. I would like to the top 5 matches for each of the doc. here goes the query that I'm using;
DECLARE @FTE hierarchyid
SELECT @FTE = path_locator
from dbo.LatinBooks
Select top (5)
e.name
,d.name as MatchedFTE
,KEY_TBL.score
FROM SEMANTICSIMILARITYTABLE
(dbo.LatinBooks,
file_stream,
@FTE ) as KEY_TBL
INNER JOIN dbo.LatinBooks d on KEY_TBL.matched_document_key= d.path_locator
left Join (select path_locator,name from dbo.LatinBooks) e on @fte=e.path_locator
Order by Key_tbl.score DESC;
This query works , it returns the top matches for the first doc. What Changes can i do to the script that it will return the matches for all 1000 docs. The results will show 5,000 rows ( One Doc and Five matches)