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 2006

Tip: Looking for answers? Try searching our database.

FullText Search

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
amarshall@newportgroup.com - 20 Jul 2006 18:05 GMT
Okay,

I believe I am missing something crucial to fulltext searching.  We are
looking at ways to change a search from using "like" to "contains" in
hopes of improving search performance on a table.  We have a fulltext
index on a lastname column.

The current search is something like this:

Declare @lastname varchar(50)

SET @lastname  = 'b'
SELECT * FROM tablename WHERE lastname like '%' + @lastname  + '%'

The above query returns all the records (over 50,000) correctly.

My question is, can fulltext searching return all records in a column
where 'b' is anywhere to be found in that column?  I'm asking because
when I use contains or freetext, the query only returns items where
lastname begins or ends with 'b' (Even using the * wildcard).

Declare @lastname varchar(50)

SET @lastname  = 'b'
SELECT * FROM tablename WHERE contains(lastname , @lastname)

Above gives 14 rows

SELECT * FROM tablename WHERE contains(lastname , '" *b* "')

Above gives 14 rows.

Any help as to whether or not I'm spinning my wheels on something that
cannot be done, would be greatly appreciated.

Thanks,

Amy Marshall
Hilary Cotter - 20 Jul 2006 19:27 GMT
No, it can't. The wildcard operator allows you to do prefix searches where
the beginning of a word or token starts with the letter b, but you can't do
full-text searches where the letter is in the middle or the end of the word.

Signature

Hilary Cotter
Director of Text Mining and Database Strategy
RelevantNOISE.Com - Dedicated to mining blogs for business intelligence.

This posting is my own and doesn't necessarily represent RelevantNoise's
positions, strategies or opinions.

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

> Okay,
>
[quoted text clipped - 34 lines]
>
> Amy Marshall
amarshall@newportgroup.com - 20 Jul 2006 19:56 GMT
Hilary,

Thanks.  I will stop spinning my wheels.

Amy
> No, it can't. The wildcard operator allows you to do prefix searches where
> the beginning of a word or token starts with the letter b, but you can't do
[quoted text clipped - 52 lines]
> >
> > Amy Marshall
 
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.