dbTalk Databases Forums  

Seaching with and without diacritical marks

comp.databases.postgresql.novice comp.databases.postgresql.novice


Discuss Seaching with and without diacritical marks in the comp.databases.postgresql.novice forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Ullrich Ralf
 
Posts: n/a

Default Seaching with and without diacritical marks - 07-13-2004 , 07:20 AM






Hello,

I have a multilingual portal running on PostgreSQL 7.4.2.
My clients come from spain,portugal, latin america and germany (mainly).
The main feature of the site is a search engine that retrieves bibliographic data, which is stored in
my database (unicode!) with diacritical marks (e.g. Panamá,América); when users enter their search terms with diacritical marks postgres will findthe requested records, but if a german user enter Panama or America (without diacritical marks), the search fails.
Is there any extension for postgres that allows for both modes of searchingon the same data?

Yours,

Ralf Ullrich

______________________
Ralf Ullrich, M.A.
Virtuelle Fachbibliothek
Ibero-Amerikanisches Institut
Preußischer Kulturbesitz
Potsdamer Str. 37
D-10785 Berlin
Germany
Phone: +49 +30 266-2512
Fax: +49 +30 266-2503
E-Mail: ullrich (AT) iai (DOT) spk-berlin.de
http://www.iai.spk-berlin.de
______________________




---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings


Reply With Quote
  #2  
Old   
Mike G
 
Posts: n/a

Default Re: Seaching with and without diacritical marks - 07-13-2004 , 08:45 PM






Automatically I don't believe so.

You can modify your queries though.

IF default search returns 0 records then
SET CLIENT_ENCODING TO 'some_other_encodin';
SELECT.....
END IF;

Maybe search for those special characters before issuing a SELECT statement.

HTH.

On Tue, Jul 13, 2004 at 02:20:48PM +0200, Ullrich Ralf wrote:
Quote:
Hello,

I have a multilingual portal running on PostgreSQL 7.4.2.
My clients come from spain,portugal, latin america and germany (mainly).
The main feature of the site is a search engine that retrieves bibliographic data, which is stored in
my database (unicode!) with diacritical marks (e.g. Panamá,América); when users enter their search terms with diacritical marks postgres will find the requested records, but if a german user enter Panama or America (without diacritical marks), the search fails.
Is there any extension for postgres that allows for both modes of searching on the same data?

Yours,

Ralf Ullrich

______________________
Ralf Ullrich, M.A.
Virtuelle Fachbibliothek
Ibero-Amerikanisches Institut
Preußischer Kulturbesitz
Potsdamer Str. 37
D-10785 Berlin
Germany
Phone: +49 +30 266-2512
Fax: +49 +30 266-2503
E-Mail: ullrich (AT) iai (DOT) spk-berlin.de
http://www.iai.spk-berlin.de
______________________


Content-Description: Ullrich Ralf.vcf

Quote:
---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo (AT) postgresql (DOT) org



Reply With Quote
  #3  
Old   
Lynna Landstreet
 
Posts: n/a

Default Re: Seaching with and without diacritical marks - 07-14-2004 , 02:36 PM



on 7/13/04 8:20 AM, Ullrich Ralf at Ullrich (AT) iai (DOT) spk-berlin.de wrote:

Quote:
I have a multilingual portal running on PostgreSQL 7.4.2.
My clients come from spain,portugal, latin america and germany (mainly).
The main feature of the site is a search engine that retrieves bibliographic
data, which is stored in
my database (unicode!) with diacritical marks (e.g. Panamá,América); when
users enter their search terms with diacritical marks postgres will find the
requested records, but if a german user enter Panama or America (without
diacritical marks), the search fails.
Is there any extension for postgres that allows for both modes of searching on
the same data?
I've been wrestling with this issue too - I'm working on an art gallery
database which includes work from a number of French-Canadian artists, plus
a few from other countries where names and image titles typically involve
accents as well.

What I've been tentatively planning to do is to handle it in the PHP
frontend rather than the database itself, by setting up a function with
strtr() (string translate) that would strip out the accents while searching
so that results would come up regardless of whether users entered the right
accent, the wrong accent or no accent at all. The strtr() function allows
you to specify a number of pairs of strings to translate, so I could make up
a list of all the commonly used accented characters and have it translate
all search text with those. I'd apply it to both the search terms entered
and the text found, so that any "a" would match any other "a", regardless of
whether it was really an à, á, ä, â or just plain a (let's see if those
accents show up in anyone's e-mail...). It's kind of the way I'm handling
case sensitivity now.


Lynna

--
Resource Centre Database Coordinator
Gallery 44: www.gallery44.org
Database Project: www.gallery44db.org



---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.