We Use Full text search and Contains
to search between records in SQL Server 2008 R2, here are the samples:
NEWS(Title): "We", "New", "Our", "Long-Term", "Seem", "Non.Active"
So as you see in the News
table the title field have the values.
We can search all of the values except "Long-Term" And "Non.Active"
, actually we can not search the words includes dash("-") or dot("."). We also check these tips:
SELECT * FROM NEWS WHERE Contains(Title, 'Non.Active');
SELECT * FROM NEWS WHERE Contains(Title, 'Non Active');
SELECT * FROM NEWS WHERE Contains(Title, 'NonActive');
SELECT * FROM NEWS WHERE Contains(Title, 'Non*');
SELECT * FROM NEWS WHERE Contains(Title, 'Active');
SELECT * FROM NEWS WHERE Contains(Title, 'Non');
SELECT * FROM NEWS WHERE Contains(Title, '*Active');
SELECT * FROM NEWS WHERE Contains(Title, ' "Non.Active" ');
SELECT * FROM NEWS WHERE Contains(Title, ' "Non Active" ');
SELECT * FROM NEWS WHERE Contains(Title, ' "NonActive" ');
SELECT * FROM NEWS WHERE Contains(Title, ' "Non*" ');
SELECT * FROM NEWS WHERE Contains(Title, ' "*Active" ');
SELECT * FROM NEWS WHERE Contains(Title, ' "Active" ');
SELECT * FROM NEWS WHERE Contains(Title, ' "Non" ');
But none of them return any result. Also we rebuild Full Text Index and yet we did not get any result.
So the question is: Is there any way to search the words include "." or "-" with full text Contains
predicate? any suggestion
UPDATE
I'm really sorry the main problem is another?
you all right about two words of "non" and "Action". but the main case I test it is "We.Our" and steel not return any result? That's so wired, I test "Non.Action" with above search and worked but "We.Our" don't. So I try another record, I inserted the "our" and the search result is yet null. The problem is about "Our" word? what is the problem with "our" I also check it in SQL Server 2012, and not worked also. is there any one have any idea about this?