SQL Server 2012 – Full Text Search [Break word – Underscore]

Posted on

Question :

Let’s say I want to search for a list containing ‘PS3’:

SELECT * FROM [TABLE] WHERE CONTAINS(Title, 'PS3')

When the Title is proceeded by an underscore it will not return it.

  1. Oblivion-PS3 -> Good
  2. Oblivion PS3 -> Good
  3. Oblivion_PS3 -> Not returning

I suppose the underscore is not a break word.

How can I fix it so that the underscore can be used as a break word?

Answer :

I found it! 🙂

I changed the Language for Word Breaker in the Full-Text Catalog to Traditional Chinese.

I used the sys.dm_fts_parser in order to find what language could use the underscore as a break word.

1033 – English

1028 – Traditional Chinese

select * from sys.dm_fts_parser('Oblivion_PS3', 1028, 5, 0)

return Oblivion AND PS3

select * from sys.dm_fts_parser('Oblivion_PS3', 1033, 5, 0)

return Oblivion_PS3

Leave a Reply

Your email address will not be published. Required fields are marked *