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 2004

Tip: Looking for answers? Try searching our database.

using wildcards

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
shank - 05 Jul 2004 15:03 GMT
I'm using FREETEXTTABLE and would like to use wildcards, but I'm not getting
expected results.
SET @SearchCriteria = '"*rose*"'
The above appears to ignore the wildcard before the text.
I also tried the LIKE operator without luck.

What's the rules for using wildcards in FREETEXTTABLE?
thanks
Narayana Vyas Kondreddi - 05 Jul 2004 16:52 GMT
You cannot use wildcards with FREETEXT. This is documented in SQL Server
Books Online. You may want to use CONTAINS instead.
Signature

HTH,
Vyas, MVP (SQL Server)
http://vyaskn.tripod.com/
Is .NET important for a database professional?
http://vyaskn.tripod.com/poll.htm

I'm using FREETEXTTABLE and would like to use wildcards, but I'm not getting
expected results.
SET @SearchCriteria = '"*rose*"'
The above appears to ignore the wildcard before the text.
I also tried the LIKE operator without luck.

What's the rules for using wildcards in FREETEXTTABLE?
thanks
shank - 05 Jul 2004 17:33 GMT
I'm trying CONTAINSTABLE and still having issues with wildcards.
How should the following statement be written?
SET @SearchCriteria LIKE '%' + 'good' + '%'
thanks

> You cannot use wildcards with FREETEXT. This is documented in SQL Server
> Books Online. You may want to use CONTAINS instead.
[quoted text clipped - 6 lines]
> What's the rules for using wildcards in FREETEXTTABLE?
> thanks
John Kane - 05 Jul 2004 18:26 GMT
Shank,
Vyas, is correct, FREETEXTTABLE does not support wildcard and to elaborate
more on the differences between CONTAINSTABLE and FREETEXTTABLE... The
FREETEXT predicate is a primitive form of natural language query, for
example you can use FREETEXT or FREETEXTTABLE with any text. e.g., multiple
words, phrases or sentences, in the <freetext search string>. You do not
need to worry about the query syntax because the MSSearch engine identifies
important words and phrases and specifically ignores wildcard ("*" or
asterisk), noise words, Boolean  operators (AND, OR, NOT), and the proximity
operator (NEAR) - then FREETEXT will return rows that contain any of the
important words and phrases. This makes FREETEXT* queries less precise than
the CONTAINS query.

Like the FREETEXT predicate, FREETEXTTABLE matches the meaning and not the
exact wording, of the words in the <freetext search string>. What exactly is
the "meaning of a word" vs. the "exact wording" is un-documented. However,
internally the MSSeearch engine wordbreaks the <freetext search string> into
it's component search terms, then generates the stemmed forms of these
terms, and assigns each term some heuristic weighting and then finds the
matches. Note, the BM25 OKAPI ranking formula is used with FREETEXT and
FREETEXTTABLE.

As for your the use of wildcards with CONTAINSTABLE, you are using the wrong
wildcard symbol. The "%" or percent sign symbol is the wildcard for T-SQL
LIKE, while the "*" or asterisk is the wildcard for CONTAINS and
CONTAINSTABLE. Additionally, only a "word prefix" wildcard is supported,
i.e., "fish*" and not "*fish" as the leading wildcard will be ignored.

Hope this helps!
Regards,
John

> I'm trying CONTAINSTABLE and still having issues with wildcards.
> How should the following statement be written?
[quoted text clipped - 12 lines]
> > What's the rules for using wildcards in FREETEXTTABLE?
> > 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.