I have a table 'Foo' with two records like this:
int | nvarchar(4000)
Col0 | Col1
------|--------------
00001 | 'Bar of SNAFU'
00002 | 'Bar SNAFU'
I want to return the record that has the 'of' separator, so I constructed a CONTAINS clause that looks like this:
SELECT *
FROM Foo
WHERE CONTAINS(*, '"Bar of*"')
0 Rows Returned
If I exchange it for a LIKE clause, it works just fine:
SELECT *
FROM Foo
WHERE Col1 LIKE 'Bar of%'
1 Row Returned
If I remove the second word from the search term in the CONTAINS clause, it returns both rows, as expected:
SELECT *
FROM Foo
WHERE CONTAINS(*, '"Bar *"')
2 Rows Returned
The problem only occurs once I include any variation of "o*" in the CONTAINS clause. I can use multiple words in the CONTAINS clause and retrieve the correct rows (verified with a separate query), so whitespace is not the issue, nor does it seem to occur with other letters. I have tried reformatting the CONTAINS to join the individual terms using the AND keyword ("Bar*" AND "of*"), but I got the same result. I need to return just the one row, and the table is rather large (hundreds of thousands of rows), so I would like to utilize the CONTAINS clause, rather than switch to a LIKE.