I have a full-text indexing table in SQL Server 2008 that I am trying to query for an exact phrase match using FULLTEXT. I do not think that using CONTAINS or LIKE is suitable for this, because in other cases the request may not be exact (the user does not surround the phrase in double quotes), and in general I want the flexibility of FREETEXT.
According to the [MSDN] documentation for FREETEXT:
If freetext_string is enclosed in double quotes, the phrase expression is executed instead; narrowing and thesaurus are not performed.
which would make me believe in such a request:
SELECT Description
FROM Projects
WHERE FREETEXT(Description, '"City Hall"')
will only return results where the term "city hall" appears in the Description field, but instead I get these results:
1 Handicap Design at Manning Hall.
2 Research antenna. Client: Cranston Engineering Department
3 Structural Investigation of Fire Damage to International Tennis Hall of Fame.
4 Research Roof research for a proposed satellite design at Herald Hall.
... etc.
Obviously, these results include at least one of the words in my phrase, but not the phrase itself. To make matters worse, I thought the results would be ranked, but the results that I really wanted (because they include the actual phrase) were buried.
SELECT Description
FROM Projects
WHERE Description LIKE '%City Hall%'
1 Quincy Massachusetts
2 , .
, , , , ? , , , ?