Re: [GENERAL] Full text index without accents

2008-07-25 Thread Jonathan Bond-Caron
cala Rodríguez'; pgsql-general@postgresql.org Subject: Re: [GENERAL] Full text index without accents Alvaro Herrera <[EMAIL PROTECTED]> writes: > Hmm, why not simply use to_ascii() ? The big problem with to_ascii is its inadequate set of supported encodings.

Re: [GENERAL] Full text index without accents

2008-07-25 Thread Tom Lane
Alvaro Herrera <[EMAIL PROTECTED]> writes: > Hmm, why not simply use to_ascii() ? The big problem with to_ascii is its inadequate set of supported encodings. Somebody *really* needs to give it some love on that front. regards, tom lane -- Sent via pgsql-general mailing

Re: [GENERAL] Full text index without accents

2008-07-25 Thread Alvaro Herrera
Jonathan Bond-Caron wrote: > This would probably help: > > CREATE OR REPLACE FUNCTION norm_text_latin(character varying) > RETURNS character varying AS > $BODY$ > declare > p_str alias for $1; > v_str varchar; > begin > select translate(p_str, 'ÀÁÂÃÄÅ', 'AA

Re: [GENERAL] Full text index without accents

2008-07-25 Thread Jonathan Bond-Caron
n v_str; end;$BODY$ LANGUAGE 'plpgsql' VOLATILE; There's also o useful functions here: http://www.project-open.org/doc/intranet-search-pg/intranet-search-pg-create.sql -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Fco. Mario Barcala R

Re: [GENERAL] Full text index without accents

2008-07-24 Thread Fco. Mario Barcala
Finally I create a function like: CREATE OR REPLACE FUNCTION nonsensible (text) RETURNS text AS $$ DECLARE var1 varchar; BEGIN var1=replace($1, 'á', 'a'); var1=replace(var1, 'é', 'e'); var1=replace(var1, 'í', 'i'); var1=replace(var1, 'ó', 'o'); var1=replace(var1, 'ú', 'u'); var1=repl

Re: [GENERAL] Full text index without accents

2008-07-22 Thread Oleg Bartunov
Here is an example CREATE FUNCTION dropatsymbol(text) RETURNS text AS 'select replace($1, ''@'', '' '');' LANGUAGE SQL; arxiv=# select to_tsvector('english',dropatsymbol('[EMAIL PROTECTED]')); to_tsvector - 'oleg':1 'sai.msu.su':2 On Tue, 22 Jul 2008, Fco. Mario

Re: [GENERAL] Full text index without accents

2008-07-22 Thread Fco. Mario Barcala
And which are the types of argument and returning values of a pl/sql function which preprocess de text? I have been searching that, for example, something like this works fine: CREATE INDEX textindex ON document USING gin(to_tsvector('english',upper(text))); where text is the text column of docu

Re: [GENERAL] Full text index without accents

2008-07-03 Thread Oleg Bartunov
You can preprocess text (replace accent by nothing) before to_tsvector or to_tsquery Oleg On Thu, 3 Jul 2008, [EMAIL PROTECTED] wrote: Hi again: I am trying to create a full text configuration to ignore word accents in my searches. My approach is similar to simple dicionary one, but i want

[GENERAL] Full text index without accents

2008-07-03 Thread lbarcala
Hi again: I am trying to create a full text configuration to ignore word accents in my searches. My approach is similar to simple dicionary one, but i want to remove accents after converting to lower. Is it the only way to do it to develop another .c and write my own dict_noaccent.c, and then com