"simple" dict with stop words in tsearch2

Lists: pgsql-general
From: "Pierre Thibaudeau" <pierdeux(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: "simple" dict with stop words in tsearch2
Date: 2007-01-29 21:12:43
Message-ID: 74b035bb0701291312q32c2b6b7q1bb60dbd78062755@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

In tsearch2, I would like to use the "simple" dictionary along with my
own list of stopwords.

In other words, once the text is parsed into tokens, no stemming
whatsoever, but stopwords are removed.

Is there an easy way to produce that result, using the standard
"simple" dictionary?


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: "simple" dict with stop words in tsearch2
Date: 2007-01-29 21:22:22
Message-ID: Pine.LNX.4.64.0701300019250.400@sn.sai.msu.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

On Mon, 29 Jan 2007, Pierre Thibaudeau wrote:

> In tsearch2, I would like to use the "simple" dictionary along with my
> own list of stopwords.
>
> In other words, once the text is parsed into tokens, no stemming
> whatsoever, but stopwords are removed.
>
> Is there an easy way to produce that result, using the standard
> "simple" dictionary?

sure, just specify dict_initoption. For example,
test=# update pg_ts_dict set dict_initoption='contrib/english.stop' where dict_name='simple';
UPDATE 1
test=# select lexize('simple', 'the');
lexize
--------
{}
(1 row)

>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Have you searched our list archives?
>
> http://archives.postgresql.org/
>

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: "Pierre Thibaudeau" <pierdeux(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: "simple" dict with stop words in tsearch2
Date: 2007-01-29 21:49:45
Message-ID: 74b035bb0701291349g6abbc90u8c6e23ea402a8b26@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

Brilliant! Thank you!

> > In tsearch2, I would like to use the "simple" dictionary along with my
> > own list of stopwords.
> > [...]
>
> sure, just specify dict_initoption. For example,
> test=# update pg_ts_dict set dict_initoption='contrib/english.stop' where dict_name='simple';
> UPDATE 1
> test=# select lexize('simple', 'the');
> lexize
> --------
> {}
> (1 row)