I appreciate your help but I need a bit of hand-holding here to get through
this.
I have a catalog created: MyCatalog
With the following columns indexed from the respective tables...
Hardware.m_Specs
Stock.OrderNo
Stock.Label
Stock.Description
Stock.Category
Stock.s_Type
Stock.Manuf
Titles.Title
Titles.Artist
I want to use CONTAINS to search all of the columns for: 'widget'
How do I get that done?
thanks very much!!!
-------------------------------
Originally, this thread was in sql.programing. I cut-n-pasted to this
newsgroup.
-------------------------------
Shank,
No, you use CONTAINS, CONTAINSTABLE, or FREETEXT, FREETEXTTBLE. See SQL
Server 2000 BOL for more on the use of these Full-text Search predicates.
You can specify either a single column or use the "*" asterisk to indicate
all FT enable columns in the FTS predicate (CONTAINS* or FREETEXT*) queries.
Note, for SQL Server 7.0, there is a FIX KB article - 286787 (Q286787) FIX:
Incorrect Results From Full-Text Search on Several Columns
http://support.microsoft.com/default.aspx?scid=kb;en-us;286787 in SQL Server
7.0 SP3 that correct this behavior to the same and default behavior for SQL
Server 2000.
Yes, you can search as many columns as necessary, but be aware that each FTS
predicate (CONTAINS* or FREETEXT*) is a "round-trip" to the FT Catalog and
depending upon the size of your FT Catalog (based upon the number of rows in
your FT enable table as well as the number of non-noise unique words), your
FTS query performance may be affected. Below are some multiple FT enable
column query examples from the Northwind database:
-- multiple columns from one FT enable table
SELECT e.LastName, e.FirstName, e.Title, e.Notes
from Employees AS e,
containstable(Employees, Notes, 'BA') as A,
containstable(Employees, Title, 'Sales') as B
where
A.[KEY] = e.EmployeeID and
B.[KEY] = e.EmployeeID
-- multiple columns from multiple tables
SELECT e.LastName, e.FirstName, e.Title, e.Notes, t.TerritoryID, A.[Rank]
from Employees AS e, EmployeeTerritories t,
containstable(Employees, Notes, 'BA') as A -- NOTE: replace with
freetexttable --> get different rank values!!
where
A.[KEY] = e.EmployeeID and
t.EmployeeID = e.EmployeeID
order by A.[Rank] DESC
Note, in order for the last example to work, you must alter the
EmployeeTerritories table and a single column, unique, non-Nullable column
and create an index on it.
Regards,
John
PS: You can also post FTS related questions to the newsgroup:
microsoft.public.sqlserver.fulltext
"shank" <shank@tampabay.rr.com> wrote in message
news:uG#gtJhWEHA.3944@tk2msftngp13.phx.gbl...
> I have 3 tables indexed for a full text catalog. I'm using ASP. Depending
on
> the table, there's 3-4 fields indexed for each table in one catalog. I
want
> to have one search box that could query any one of the above fields.
>
> Do I query the catalog itself? How?
> Do I have to query each individual table and each individual field? How?
> Should I be dumping my selected field's data into one separate table and
> index that table instead?
>
> How do I move forward?
> thanks!
Hilary Cotter - 25 Jun 2004 16:38 GMT
select * from tablename where contains(*,'searchphrase') will do it.

Signature
Hilary Cotter
Looking for a book on SQL Server replication?
http://www.nwsu.com/0974973602.html
> I appreciate your help but I need a bit of hand-holding here to get through
> this.
[quoted text clipped - 79 lines]
> > How do I move forward?
> > thanks!
shank - 26 Jun 2004 04:42 GMT
But I have 3 tables! How do I search all these fields in 3 different tables?
> > Hardware.m_Specs
> > Stock.OrderNo
[quoted text clipped - 5 lines]
> > Titles.Title
> > Titles.Artist
> select * from tablename where contains(*,'searchphrase') will do it.
>
[quoted text clipped - 90 lines]
> > > How do I move forward?
> > > thanks!