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 / October 2007

Tip: Looking for answers? Try searching our database.

'%phrase%' search

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
fayna - 22 Oct 2007 11:12 GMT
Hi,
I'd like to know if it's possible to implement the search '%word|phrase%'
with full text catalog.
I've tried with "...CONTAINS(FIELD,'"word|phrase"')" but I don't get the
same result as using "... FIELD LIKE '%word|phrase%'".
Full text search is faster than LIKE search but it return less rows.

Thanks
Daniel Crichton - 22 Oct 2007 11:43 GMT
fayna wrote  on Mon, 22 Oct 2007 03:12:00 -0700:

> Hi,
> I'd like to know if it's possible to implement the search
[quoted text clipped - 3 lines]
> the  same result as using "... FIELD LIKE '%word|phrase%'".
> Full text search is faster than LIKE search but it return less rows.

> Thanks

You cannot use a wildcard at the start of a word, only at the end. You can
do the following, for instance

CONTAINS(FIELD,'"word*"')

which will find all words beginning with "word", which would include "word",
"wordy", "worded", "wording", etc.

But you can't use the * at the start of a word.

Also, with a phrase the result may be unexpected because the * applies to
each word in the phrase, so

CONTAINS(FIELD,'"my phrase*"')

willl match with "my phrase", "my phraser", "myer phrase", etc etc

FTS will only ever work like LIKE if you are searching for specific whole
single words or phrases.

Signature

Dan

Hilary Cotter - 23 Oct 2007 01:55 GMT
also SQL FTS will throw out the middle character. It knows something is
there, but not what. So it will match on

word!phrase
word$phrase
and
word phrase amoung others.

Signature

RelevantNoise.com - dedicated to mining blogs for business intelligence.

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

> fayna wrote  on Mon, 22 Oct 2007 03:12:00 -0700:
>
[quoted text clipped - 27 lines]
> FTS will only ever work like LIKE if you are searching for specific whole
> single words or phrases.
Daniel Crichton - 23 Oct 2007 14:19 GMT
Hilary wrote  on Mon, 22 Oct 2007 20:55:24 -0400:

> also SQL FTS will throw out the middle character. It knows something is
> there, but not what. So it will match on

> word!phrase word$phrase and word phrase amoung others.

I think the word|phrase wasn't an explicit string, rather the | represents
an optional value, ie. it would be looking for a word, or a phrase.

Signature

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.