retrieving keys from a GIN index on a tsvector column in Postgres 9.1?

Lists: pgsql-general
From: Chris Esposito <chris(dot)esposito(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: retrieving keys from a GIN index on a tsvector column in Postgres 9.1?
Date: 2012-10-18 19:13:59
Message-ID: CAF6hsPjHgoHWgsH62JbTiZnqHP0-JqZS7xzVyS+pMC6AfLx4bQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

Hi,
I've got a collection of documents that I'd like to do some full text
searching on in Postgres 9.1, so adding them as the contents of a tsvector
and then creating a GIN index on this column seems straightforward enough.
My understanding of the GIN index is that the keys used are (depedning on
the text search configuration used) either the list of original words or
their normalized lexemes from the collection of original documents.
However, for other functionality we've developed I'd really like to get
that list of keys out of the GIN index to put in another column in a
different table for use. Is this possible?

Thanks,
Chris


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Chris Esposito <chris(dot)esposito(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: retrieving keys from a GIN index on a tsvector column in Postgres 9.1?
Date: 2012-10-18 21:06:30
Message-ID: 5178.1350594390@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

Chris Esposito <chris(dot)esposito(at)gmail(dot)com> writes:
> I've got a collection of documents that I'd like to do some full text
> searching on in Postgres 9.1, so adding them as the contents of a tsvector
> and then creating a GIN index on this column seems straightforward enough.
> My understanding of the GIN index is that the keys used are (depedning on
> the text search configuration used) either the list of original words or
> their normalized lexemes from the collection of original documents.

If you're storing a tsvector column, it already has done all the text
processing involved --- I don't believe GIN is adding anything, it's
just indexing the elements of the tsvector.

regards, tom lane


From: Craig Ringer <ringerc(at)ringerc(dot)id(dot)au>
To: Chris Esposito <chris(dot)esposito(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: retrieving keys from a GIN index on a tsvector column in Postgres 9.1?
Date: 2012-10-19 05:24:37
Message-ID: 5080E415.7070407@ringerc.id.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

On 10/19/2012 03:13 AM, Chris Esposito wrote:
> Hi,
> I've got a collection of documents that I'd like to do some full
> text searching on in Postgres 9.1, so adding them as the contents of a
> tsvector and then creating a GIN index on this column seems
> straightforward enough.

Is this your SO question?

http://stackoverflow.com/questions/12961459/retrieving-keys-from-a-gin-index-on-a-tsvector-column-in-postgres-9-1

If so, please link back to SO questions when posting on the mailing list
and vice versa, so others who're looking for information later can find
both.

--
Craig Ringer