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 / January 2005

Tip: Looking for answers? Try searching our database.

FreeText on multiple columns

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
dotNet - 26 Jan 2005 10:30 GMT
Hello!

I need to do a freetext-search on multiple columns in the same table,
searching with the same keywords.

For example

WHERE FREETEXT({col1, col2}, "searching for this")

I know that this can be accomplished through

WHERE FREETEXT(col1, "searching for this")
      OR FREETEXT(col2, "searching for this")

but then it will query the FTS-database (in this case) two times. But
the more oclumns the more queryies against the FTS-database.

I tried to concatenate the columns, like

WHERE FREETEXT(col1+col2, "searching for this")

but that wont work.

I know that this is possible to do through contains/containstable, but I
need to use freetext this time.

Suggestions?

Thanks
dotNet - 26 Jan 2005 11:06 GMT
I just figured out that since I only have one FT-catalog (which has all
the columns I want to query against) on the table, I can do

WHERE FREETEXT(*, "searching for this")

> Hello!
>
[quoted text clipped - 25 lines]
>
> Thanks
Hilary Cotter - 26 Jan 2005 14:42 GMT
This is correct. With FreeText and FreeTextTable if you issue queries where
you don't qualify the column name(s) and your search phrase consists of more
than 1 token, ie "searching for this" has three tokens or words, your search
results might come from different columns. IE Searching in col1, for in
col2, and this in col3.  Keep in mind that for, and this are noise words.
With a Contains and ContainsTable searches, all the tokens/words will have
to be in the same column for you to get a hit.

Signature

Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html

> I just figured out that since I only have one FT-catalog (which has all
> the columns I want to query against) on the table, I can do
[quoted text clipped - 30 lines]
> >
> > Thanks
 
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.