Full Text Search Query in MSSQL 2008 in ASP
Posted on 2010-01-06
I've got the following full text query:
Search string being entered:
SearchWords = "apple pear orange"
SELECT distinct P.Title, P.Description, P.Link, R.RANK FROM TWS4UProducts as P INNER JOIN CONTAINSTABLE (TWS4UProducts,(title,description),'(" & """" & SearchWords & """" & ")') as R ON P.ID1 = R.[KEY] ORDER BY Rank DESC;
How can the above query be re-written so that it works for:
1) Find any word i.e. apple OR pear OR orange
2) Find all words i.e. apple AND pear AND orange
3) Find exact phrase i.e. "apple pear orange"