Re: Fulltext index - Mailing list pgsql-general

From Ivan Sergio Borgonovo
Subject Re: Fulltext index
Date
Msg-id 20081108141829.0c71abbb@dawn.webthatworks.it
Whole thread Raw
In response to Fulltext index  (Andreas Kraftl <andreas.kraftl@kraftl.at>)
List pgsql-general
On Sat, 08 Nov 2008 09:44:17 +0100
Andreas Kraftl <andreas.kraftl@kraftl.at> wrote:

> Hello again,

> my previous post wasn't answered. I think i told my question
> wrong :-).
>
> I have a table like
> a    | b
> --------------------
> 'de' | Hallo welt
> 'en' | Hello world
>
> How can I create a full text index over b?
> CREATE INDEX idx ON table USING gin(
> to_tsvector(
>     case
>         when a = 'de' then 'german'
>         when a = 'en' then 'english'
>         else 'english'
>     end
> ), b);
>
> This doesn't work. Error Message in german:
> FEHLER: Zugriffsmethode »gin« unterstützt keine mehrspaltigen
> Indexe SQL state: 0A000
> means, gin doesn't accept multicolumn indexes.
>
> Any ideas?

Multicolumn indexes should get into 8.4.

You may add a column tsvector and compute it with a trigger that
chose the correct language when generating the tsvector.
Then you'll have to pick up the correct language when you generate
the tsquery in your search.

http://www.sigaev.ru/gin/fastinsert_and_multicolumn_GIN.pdf

--
Ivan Sergio Borgonovo
http://www.webthatworks.it


pgsql-general by date:

Previous
From: Andreas Kretschmer
Date:
Subject: Re: grant privileges
Next
From: Garry Saddington
Date:
Subject: Re: grant privileges