Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
DB Engine
SQL ServerMSDESQL Server CE
Services
Analysis (Data Mining)Analysis (OLAP)DTSIntegration ServicesNotification ServicesReporting Services
Programming
CLRConnectivitySQLXML
Other Technologies
ClusteringEnglish QueryFull-Text SearchReplicationService Broker
General
Data WarehousingPerformanceSecuritySetupSQL Server ToolsOther SQL Server Topics
DirectoryUser Groups
Related Topics
MS AccessOther DB ProductsMS Server Products.NET DevelopmentVB DevelopmentJava DevelopmentMore Topics ...

SQL Server Forum / Other Technologies / Full-Text Search / July 2005

Tip: Looking for answers? Try searching our database.

CONTAINS

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Leila - 18 Jul 2005 00:44 GMT
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
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.