Thread: GiST and full text search

GiST and full text search

From
Wei Weng
Date:
Hi all.

I have been doing a little research on how to do full text search under 
postgresql, and GiST seems to be the way to go. But the documentation on 
this is pretty lacking and I wonder if there are better sources that 
describe the details on how to implement full text search with GiST.

Thanks

Wei



Re: GiST and full text search

From
Richard Huxton
Date:
On Monday 22 September 2003 16:02, Wei Weng wrote:
> Hi all.
>
> I have been doing a little research on how to do full text search under
> postgresql, and GiST seems to be the way to go. But the documentation on
> this is pretty lacking and I wonder if there are better sources that
> describe the details on how to implement full text search with GiST.

Have you looked at tsearch / tsearch2 in the contrib/ directory?

--  Richard Huxton Archonet Ltd


Re: GiST and full text search

From
Wei Weng
Date:
The production server uses PostgreSQL 7.3.1 right now, so I am only 
looking at contrib/tsearch.

I read through the README file. It only seems to offer a way to FTS 
through one 'text' column in the table. How do I create a 'txtidx' column 
that combines two or even more 'text' columns in the table?

Thanks

Wei

On Mon, 22 Sep 2003, Richard Huxton wrote:

> On Monday 22 September 2003 16:02, Wei Weng wrote:
> > Hi all.
> >
> > I have been doing a little research on how to do full text search under
> > postgresql, and GiST seems to be the way to go. But the documentation on
> > this is pretty lacking and I wonder if there are better sources that
> > describe the details on how to implement full text search with GiST.
> 
> Have you looked at tsearch / tsearch2 in the contrib/ directory?
> 
> 


Re: GiST and full text search

From
Richard Huxton
Date:
On Monday 22 September 2003 16:41, Wei Weng wrote:
> The production server uses PostgreSQL 7.3.1 right now, so I am only
> looking at contrib/tsearch.
>
> I read through the README file. It only seems to offer a way to FTS
> through one 'text' column in the table. How do I create a 'txtidx' column
> that combines two or even more 'text' columns in the table?

According to README.tsearch from 7.4beta (not tsearch2 which is the new one)

Current syntax allows creating trigger for several columns
you want to be searchable:
 create trigger txtidxupdate before update or insert on titles for each row execute procedure tsearch(titleidx, title1,
title2,...);
 

Perhaps see what 7.3.4's tsearch says - that should be compatible with 7.3.1
--  Richard Huxton Archonet Ltd


Re: GiST and full text search

From
"Andrew J. Kopciuch"
Date:
On Monday 22 September 2003 09:41, Wei Weng wrote:
> The production server uses PostgreSQL 7.3.1 right now, so I am only
> looking at contrib/tsearch.
>

tsearch2 is compatible, and available for any version of PosgreSQL 7.3.  It is 
not included in the contrib directory.  It is available in CVS head and will 
be in 7.4 contrib AFAIK.

You can download the stable version here:

http://www.sai.msu.su/~megera/postgres/gist/tsearch/V2/tsearch-v2-stable.tar.gz

There are full installation instructions in the introdution.  See below.

> I read through the README file. It only seems to offer a way to FTS
> through one 'text' column in the table. How do I create a 'txtidx' column
> that combines two or even more 'text' columns in the table?
>

Read the introduction documentation.  It explains this in detail, plus many 
other things you might want to know:

http://www.sai.msu.su/~megera/postgres/gist/tsearch/V2/docs/tsearch-V2-intro.html


Andy


Re: GiST and full text search

From
Oleg Bartunov
Date:
On Mon, 22 Sep 2003, Wei Weng wrote:

> The production server uses PostgreSQL 7.3.1 right now, so I am only
> looking at contrib/tsearch.

you may download tsearch2 for 7.3.X from
http://www.sai.msu.su/~megera/postgres/gist/tsearc/V2

>
> I read through the README file. It only seems to offer a way to FTS
> through one 'text' column in the table. How do I create a 'txtidx' column
> that combines two or even more 'text' columns in the table?
>
> Thanks
>
> Wei
>
> On Mon, 22 Sep 2003, Richard Huxton wrote:
>
> > On Monday 22 September 2003 16:02, Wei Weng wrote:
> > > Hi all.
> > >
> > > I have been doing a little research on how to do full text search under
> > > postgresql, and GiST seems to be the way to go. But the documentation on
> > > this is pretty lacking and I wonder if there are better sources that
> > > describe the details on how to implement full text search with GiST.
> >
> > Have you looked at tsearch / tsearch2 in the contrib/ directory?
> >
> >
>
> ---------------------------(end of broadcast)---------------------------
> TIP 7: don't forget to increase your free space map settings
>
Regards,    Oleg
_____________________________________________________________
Oleg Bartunov, sci.researcher, hostmaster of AstroNet,
Sternberg Astronomical Institute, Moscow University (Russia)
Internet: oleg@sai.msu.su, http://www.sai.msu.su/~megera/
phone: +007(095)939-16-83, +007(095)939-23-83