次の方法で共有


'Gotchas' on searching for 'AT&T'? 'M&M'? etc..

Generally, WBs will parse the '&' character as a separator and therefore emit the terms on both sides of this character. We already posted on this blog how to avoid this default behavior by using custom dictionaries.

 Note the following though, SQL Server Full-Text Search Parser will see this character as an abreviation of an AND, therefore when you search for:

...CONTAINS('AT&T',.....)

 Whether you have included this word in your custom dictionary or not, the query will be internally translated to:

...CONTAINS('AT AND T',......)

 Thus, not applying the entry for AT&T in the custom dictionary.

 In order to avoid this transformation, you need to use double quotes indicating you are searching for a phrase, thus such transformation should not take place. i.e:  ....CONTAINS ("AT&T",....).

This will work correctly and if you added this word to your custom dictionary, it won't be tokenized but stored as-is into the FTIndex.

Hope this helps!.