Searching with regular characters for special characters

20 views
Skip to first unread message

Marcel van Langen - Morloff

unread,
Aug 23, 2016, 9:07:51 AM8/23/16
to Railo
Hello all,

I have a question. I have open text search fields in an application. You can search for anything. It doesn't use collections or anything, it just results in a LIKE statement in a SQL query (with some additional intelligence). Let's say I have the following names in a database field:

Freire
André

Now when the user searches for 're', I want both names to be returned. But since André has a special character, the SQL query only finds Freire.

Hope you can shed some light on this!

Marcel

Jeroen Knoef

unread,
Aug 24, 2016, 3:02:42 AM8/24/16
to Railo
Which database server do you use and which collation is set on the table?

Marcel van Langen - Morloff

unread,
Aug 24, 2016, 9:54:15 AM8/24/16
to Railo
Heee Jeroen! I'm using SQL Server 2014 and the collation is (in this case) set to SQL_Latin1_General_CP1_CI_AS...

Jochem van Dieten

unread,
Aug 26, 2016, 12:29:23 PM8/26/16
to ra...@googlegroups.com
On Wed, Aug 24, 2016 at 3:54 PM, Marcel van Langen - Morloff wrote:
> Heee Jeroen! I'm using SQL Server 2014 and the collation is (in this case)
> set to SQL_Latin1_General_CP1_CI_AS...

If you cast to some AI (accent insensitive) collation in your SQL the
accents should be ignored. It will be even slower than your current
LIKE solution though.

Jochem
Reply all
Reply to author
Forward
0 new messages