I'm have some trouble with the fulltext CONTAINS operator. Here's a quick script to show what I'm doing. Note that the WAITFOR line simply gives the fulltext index a moment to finish filling up.
create table test1 ( id int constraint pk primary key, string nvarchar(100) not null );
insert into test1 values (1, 'dog')
insert into test1 values (2, 'dogbreed')
insert into test1 values (3, 'dogbreedinfo')
insert into test1 values (4, 'dogs')
insert into test1 values (5, 'breeds')
insert into test1 values (6, 'breed')
insert into test1 values (7, 'breeddogs')
go
create fulltext catalog cat1
create fulltext index on test1 (string) key index pk on cat1
waitfor delay '00:00:03'
go
select * from test1 where contains (string, '"*dog*"')
go
drop table test1
drop fulltext catalog cat1
The result set returned is:
1 dog
2 dogbreed
3 dogbreedinfo
4 dogs
Why is record #7 'breeddogs' not returned?
EDIT
Is there another way I should be searching for strings that are contained in other strings? A way that is faster than LIKE '%searchword%' ?