I have a Products table in a SQL Server database and I am having to troubleshoot a legacy stored procedure that uses Full-Text indexing. For our purposes here, lets suppose that the Products table has two fields ID, Keywords. And the Keywords field is populated with the following:
ROLAND SA-300 This Roland SA-300 is in MINT condition!
When I run the following statement, I am able to retrieve the record:
SELECT * FROM Products WHERE Keywords LIKE '%SA-300%'
However, when I run any of the following statements I get zero results:
SELECT * FROM Products WHERE CONTAINS(Keywords, ' SA-300 ')
SELECT * FROM Products WHERE CONTAINS(Keywords, 'SA-300')
SELECT * FROM Products WHERE CONTAINS(Keywords, '"SA-300"')
SELECT * FROM Products WHERE CONTAINS(Keywords, '"*SA-300*"')
But I know that the CONTAINS() function is working because I get results when I run any of these:
SELECT * FROM Products WHERE CONTAINS(Keywords, ' Roland ')
SELECT * FROM Products WHERE CONTAINS(Keywords, 'Roland')
SELECT * FROM Products WHERE CONTAINS(Keywords, '"Roland"')
SELECT * FROM Products WHERE CONTAINS(Keywords, '"*Roland*"')
SELECT * FROM Products WHERE CONTAINS(Keywords, 'Roland')
I need to figure out why the CONTAINS() function isn't working on the 'SA-300' term. I am new to Full-text indexes, so any help is appreciated.