From: | Oleg Bartunov <oleg(at)sai(dot)msu(dot)su> |
---|---|
To: | Pierre Thibaudeau <pierdeux(at)gmail(dot)com> |
Cc: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: tsearch strategy for incremental search |
Date: | 2008-06-30 06:00:25 |
Message-ID: | Pine.LNX.4.64.0806300958120.11363@sn.sai.msu.ru |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Pierre,
you, probably, can use custom configuration, which uses pg_3chars
dictionary.
Oleg
On Mon, 30 Jun 2008, Pierre Thibaudeau wrote:
> 2008/6/30 Oleg Bartunov <oleg(at)sai(dot)msu(dot)su>:
>> tsearch will have prefix search support in 8.4.
>
> Thanks Oleg! That's fantastic news!
>
> In the meantime, carrying on with my earlier idea, here's the little
> function I came up with for extracting the 3-char-lexeme tsvector, in
> case anyone's interested:
>
> CREATE OR REPLACE FUNCTION public.to_three_char_tsvector(str text)
> RETURNS tsvector AS
> $BODY$declare
> somerow record;
> shortened_text text := '';
> BEGIN
> FOR somerow IN SELECT regexp_split_to_table(trim(both '\'' from
> strip(to_tsvector('simple',str))::text),'\'') AS item LOOP
> shortened_text := shortened_text || ' ' ||
> COALESCE(substring(somerow.item for 3), '');
> END LOOP;
> RETURN strip(to_tsvector(shortened_text));
> END;$BODY$
> LANGUAGE 'plpgsql' IMMUTABLE;
>
>
Regards,
Oleg
_____________________________________________________________
Oleg Bartunov, Research Scientist, Head of AstroNet (www.astronet.ru)
Sternberg Astronomical Institute, Moscow University, Russia
Internet: oleg(at)sai(dot)msu(dot)su, http://www.sai.msu.su/~megera/
phone: +007(495)939-16-83, +007(495)939-23-83
From | Date | Subject | |
---|---|---|---|
Next Message | Fernando Dominguez | 2008-06-30 06:55:15 | re-using cluster |
Previous Message | Pierre Thibaudeau | 2008-06-30 05:38:21 | Re: tsearch strategy for incremental search |