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
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