I am working on a SQL Server 2008R2 query that leverages full text searching to find the appropriate rows with the data. However, I also have the requirement of providing which words matched when the terms were evaluated using OR inside CONTAINS() or CONTAINSTABLE(). I cannot seem to find or come up with a way to produce the results that doesn't require each term being re-evaluated for the presence of the term. ---------- Query to find associated records: SELECT documentId, content FROM dbo.tbl_Documents d INNER JOIN CONTAINSTABLE(tbl_Documents, contents, '"*West*" OR "*Consent*" OR "*Test*"') AS filter ON d.documentId = filter.[Key] ---------- This returns: documentId content 7 West of the Mississippi 10 West today, I consent. 13 West yesterday, east today, let us test. ---------- However, I need something like this: documentId content matchSet 7 West of the Mississippi west 10 West today, I consent. west, consent 13 West yesterday, east today, let us test. west, test
Any ideas or suggestions on where to start? I decided to post this question to the forums [here...][1] [1]:
http://www.sqlservercentral.com/Forums/Topic1124709-392-1.aspx?Update=1