Re: search on accents over all possible matches
От | David Lizano |
---|---|
Тема | Re: search on accents over all possible matches |
Дата | |
Msg-id | 4.3.2.7.0.20010327185220.00c1cc10@192.168.1.1 обсуждение исходный текст |
Ответ на | search on accents over all possible matches (Jaume Teixi <teixi@6tems.com>) |
Список | pgsql-admin |
At 18.24 27/3/01 +0200, you wrote: >Hello, > >I'm developing a search tool with php against a posgresql database. >As the database is in catalan an in spanish is obvious that a simple >search like: >(SELECT * FROM painters WHERE artist_name ~* 'Dali'); > >should perform over Dd Aa Ll Ii (and will not found Dalí). >but on an accent based language also should perform over ÍíÌìÏï > >question is: > >this c function from Patrice Hédé is the most appropiate tool for >searching on an accent based language ? >http://www.postgresql.org/mhonarc/pgsql-sql/1998-06/msg00119.html > >or should I use an implemented function inside postgres right now ? > >bests from barcelona, >jaume teixi. Using regular expressions from PHP you can convert "a" into "[Aaáä]" and from the original SQL query: (SELECT * FROM painters WHERE artist_name ~* 'Dali'); You obtain (SELECT * FROM painters WHERE artist_name ~* 'D[Aaáä]l[Iiíï]'); generating a new complete regular expression for the SQL language. It should be valid for Dali, Dáli, Dalí, Dálí, and others. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ David Lizano - Director área técnica correo-e: david.lizano@izanet.com I Z A N E T - Servicios integrales de internet. web: http://www.izanet.com/ Dirección: C/ Checa, 57-59, 3º D - 50.007 Zaragoza (España) Teléfono: +34 976 25 80 23 Fax: +34 976 25 80 24 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
В списке pgsql-admin по дате отправления: