Let's say I have a table with Author info. The author's name is stored in the format "LastName, FirstName" (ex: King, Stephen). This table is queried by a site which uses Full Text Search in Sql Server 2008. The end user will almost always enter "Stephen King" which brings back no results. However, if the user types "King Stephen", results will come back. An example query that works looks like this:
DECLARE @SearchWord nvarchar(30)
SET @SearchWord = N'"' + 'king stephen' + '"'
SELECT Author
FROM Items
WHERE CONTAINS(Author, @SearchWord)
Any ideas why I can't get the common search term ("Stephen King") to work while the uncommon way ("King Stephen") works? It could be due to the quotes around the search term, but I'm not sure how to work around this. Any ideas? Thanks.