Hi,
I have a table like this:
CREATE TABLE T1(
C1 int identity(1,1) PRIMARY KEY,
C2 NVARCHAR(50))
INSERT T1(C2) VALUES('test')
INSERT T1(C2) VALUES('Xtest')
INSERT T1(C2) VALUES('testX')
Assuming that C2 is enabled for FTS, this query does not return "Xtest":
SELECT * FROM T1 WHERE CONTAINS (*,'"*test*"')
It returns only "test" and "testX". How can I do that?
Thanks in advance,
Leila
Daniel Crichton - 18 Jul 2005 09:30 GMT
> Hi,
> I have a table like this:
[quoted text clipped - 12 lines]
>
> It returns only "test" and "testX". How can I do that?
You can't, unless you use "Xtest" or "Xtest*". FTS doesn't handle suffix
searches, and so the leading * is ignored. Another option would be to fall
back to LIKE when a leading * is used.
Dan
Hilary Cotter - 18 Jul 2005 11:16 GMT
I think you mean prefix (comes before) which SQL FTS does not support. SQL
FTS does support suffix (comes at the end) type searches when you use the
wildcard operator in the Contains predicate.

Signature
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
>
> > Hi,
[quoted text clipped - 19 lines]
>
> Dan
Daniel Crichton - 18 Jul 2005 12:44 GMT
>I think you mean prefix (comes before) which SQL FTS does not support. SQL
> FTS does support suffix (comes at the end) type searches when you use the
> wildcard operator in the Contains predicate.
Possibly, I can't remember which way around they go. If it refers to the
string part, it's suffix that isn't supported as the wildcard will be the
prefix. Thanks for pointing out my error though :)
Dan
Leila - 18 Jul 2005 23:02 GMT
Thank you all :-)
Then LIKE will be the only poosible way?
> >I think you mean prefix (comes before) which SQL FTS does not support. SQL
> > FTS does support suffix (comes at the end) type searches when you use the
[quoted text clipped - 5 lines]
>
> Dan
Hilary Cotter - 19 Jul 2005 19:41 GMT
Unfortunately so.

Signature
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
> Thank you all :-)
> Then LIKE will be the only poosible way?
[quoted text clipped - 10 lines]
> >
> > Dan