SQL Server Developer Center > SQL Server Forums > SQL Server Search > Contains with wildcard iqnores special character
Ask a questionAsk a question
 

AnswerContains with wildcard iqnores special character

  • Tuesday, October 20, 2009 1:13 PMGentleman35 Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Having fts catalog with accent sensitive = true and language on column is set to swedish. A test table contains the following values:

    bjornfot
    uk bjorn
    björnfot
    uk björn

    then when i run this query:

    select

     

    * from SearchWords where contains(*,N'"*björn*"')

    results:
    uk björn

    which should be:
    björnfot
    uk björn

    then when running:

    select

     

    * from SearchWords where contains(*,N'"*bjorn*"')

     

     

    results:
    bjornfot
    uk bjorn
    björnfot
    uk björn

    which it should be:
    bjornfot
    uk bjorn


    Any idrea of why the results are so?

    thanks in advance!

Answers

  • Tuesday, October 27, 2009 3:02 PMHilary CotterMVPUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
    a couple of points. you can't do prefix based searches, ie *stuff is invalid and the * is ignored. stuff* is correct and you will get matches to any rows where the full-text columns have words in them starting with stuff.

    To get what you are looking for, ie the umlat to be ignored, you will need to set accent_sensitivity off.
    looking for a book on SQL Server replication? http://www.nwsu.com/0974973602.html looking for a book on SQL Server 2008 Administration? http://www.amazon.com/Microsoft-Server-2008-Management-Administration/dp/067233044X looking for a book on SQL Server 2008 Full-Text Search? http://www.amazon.com/Pro-Full-Text-Search-Server-2008/dp/1430215941

All Replies

  • Tuesday, October 27, 2009 3:02 PMHilary CotterMVPUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
    a couple of points. you can't do prefix based searches, ie *stuff is invalid and the * is ignored. stuff* is correct and you will get matches to any rows where the full-text columns have words in them starting with stuff.

    To get what you are looking for, ie the umlat to be ignored, you will need to set accent_sensitivity off.
    looking for a book on SQL Server replication? http://www.nwsu.com/0974973602.html looking for a book on SQL Server 2008 Administration? http://www.amazon.com/Microsoft-Server-2008-Management-Administration/dp/067233044X looking for a book on SQL Server 2008 Full-Text Search? http://www.amazon.com/Pro-Full-Text-Search-Server-2008/dp/1430215941