Friday, March 23, 2012

parameter

Hi,

I am using a stored proc which takes in a parameter from a webpage. I am using freetext and have to pass in a parameter inside quotes so that freetext treats the phrase as a single word.

something similar to this.

freetext(SITE_NAME,' " '+ @.Search+' " ')

this is giving error.

Please Help

try using the char function passing it the numeric ascii code for double quotes in your sql statement: char(39)

|||

Hi bendJoe,

I am using freetext and have to pass in a parameter inside quotes so that freetext treats the phrase as a single word

Could you please give us an example what the @.Search parameter could be? Also, why do you want FreeText function treate your search words as a singe world?

Based on my understanding, we can pass in more than one words into FreeText predicate and those words will be seperated and assigend a weight value automatically. And that's how FreeText function is designed. See the defination in Books Online:

Is a predicate used to search columns containing character-based data types for values that match the meaning and not the exact wording of the words in the search condition. When FREETEXT is used, the full-text query engine internally performs the following actions on thefreetext_string, assigns each term a weight, and then finds the matches.

Separates the string into individual words based on word boundaries (word-breaking).

Generates inflectional forms of the words (stemming).

Identifies a list of expansions or replacements for the terms based on matches in the thesaurus.

No comments:

Post a Comment