Home > Archive > MS SQL Server > July 2005 > full text searches









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author full text searches
ChrisR

2005-07-15, 8:23 pm

sql2k sp3a

Im having a hard time getting my head into full text searches. I really dont
understand the difference between a full test search and a LIKE clause?

If its not too much trouble, could someone please provide an example of a
query that can ONLY be done using a full text search and not the LIKE
clause.


TIA, ChrisR


Tibor Karaszi

2005-07-16, 3:23 am

The key is to study CONTAINS, FREETEXT, CONTAINSTABLE and FREETEXTTABLE. For example, here are a
couple of examples from Books Online, CONTAINS:

F. Use CONTAINS with <generation_term>
This example searches for all products with words of the form dry: dried, drying, and so on.

USE Northwind
GO
SELECT ProductName
FROM Products
WHERE CONTAINS(ProductName
, ' FORMSOF (INFLECTIONAL, dry) ')
GO
G. Use CONTAINS with <weighted_term>
This example searches for all product names containing the words spread, sauces, or relishes, and
different weightings are given to each word.

USE Northwind
GO
SELECT CategoryName, Description
FROM Categories
WHERE CONTAINS(Description
, 'ISABOUT (spread weight (.8),
sauces weight (.4), relishes weight (.2) )' )
GO

--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www. solidqualitylearning
.com/

Blog: http:// solidqualitylearning
.com/blogs/tibor/



"ChrisR" <noemail@bla.com> wrote in message news:uqZGHZZiFHA.3056@TK2MSFTNGP10.phx.gbl...
> sql2k sp3a
>
> Im having a hard time getting my head into full text searches. I really dont understand the
> difference between a full test search and a LIKE clause?
>
> If its not too much trouble, could someone please provide an example of a query that can ONLY be
> done using a full text search and not the LIKE clause.
>
>
> TIA, ChrisR
>


Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com