Skip to content Skip to sidebar Skip to footer

Sql Server Full-text Search With Prefix And Noise Word

I do not understand why following Query1 and Query2 don't return similar result sets. Samples Query1: select * from dbo.tFTS_test where contains (*, ''qwe-asd*'') Returns: Id

Solution 1:

The difference is caused by the hyphen, Full Text Search is treating your query string as two words instead of one. And additionally, since "asd" is a noise word it will not find it.

When the word breaker encounters a word-breaking character in a term, the word breaker parses the character as a white space character.

Word-breaking characters include the following:

  • •$ (dollar sign)
  • , (comma)
  • & (ampersand)
  • # (number sign)

When the word breaker encounters a hyphen (-) in a term, the word breaker correctly parses the term. However, the full-text thesaurus component treats the characters that are connected by the hyphen together with the hyphen itself as empty characters. For example, if the original term is "well-known celebrity," the term appears as "celebrity" in the thesaurus file.

This is from the Microsoft site, not the same problem but one that share the root cause:

You obtain incorrect results when you run a full-text search query that uses a thesaurus file in SQL Server 2005

Post a Comment for "Sql Server Full-text Search With Prefix And Noise Word"