Re: Fix for stop words in thesaurus file

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: PostgreSQL-patches <pgsql-patches(at)postgresql(dot)org>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Oleg Bartunov <oleg(at)sai(dot)msu(dot)su>, Teodor Sigaev <teodor(at)sigaev(dot)ru>
Subject: Re: Fix for stop words in thesaurus file
Date: 2007-11-10 15:40:34
Message-ID: 200711101540.lAAFeYS20251@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers pgsql-patches

Bruce Momjian wrote:
> Tom Lane wrote:
> > Bruce Momjian <bruce(at)momjian(dot)us> writes:
> > > Tom Lane wrote:
> > >> One possible real solution would be to tweak the dictionary APIs so
> > >> that the dictionaries can find out whether this is the first load during
> > >> a session, or a reload, and emit notices only in the first case.
> >
> > > Yea, that would work too. Or just throw an error for a stop word in the
> > > file and then you never get a reload (use "*" instead).
> >
> > Hm, that's a thought --- it'd be a way to solve the problem without an
> > API change for dictionaries, which is something to avoid at this late
> > stage of the 8.3 cycle. Come to think of it, does the ts_cache stuff
> > work properly when an error is thrown in dictionary load (ie, is the
> > cache entry left in a sane state)?
>
> I have developed the attached patch which uses "?" to mark stop words in
> the thesaurus file. ("*" was already in use in the file.) I updated
> the docs to use "?", which makes the documentation clearer too.
>
> The patch also reenables testing of stop words in the thesuarus file.
>
> FYI, there is no longer a NOTICE for stop words in the thesaurus file;
> it throws an error now, and says to use "?" instead.

Patch applied. I added documentation on this API change too.

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://postgres.enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +

In response to

Browse pgsql-committers by date

  From Date Subject
Next Message Bruce Momjian 2007-11-10 16:15:24 pgsql: Use strip -x on OS/X-darwin because non-"-x" causes link
Previous Message Bruce Momjian 2007-11-10 15:39:34 pgsql: Have text search thesaurus files use "?" for stop words.

Browse pgsql-hackers by date

  From Date Subject
Next Message Jacques Caron 2007-11-10 16:04:59 Re: autovacuum_freeze_max_age
Previous Message Bruce Momjian 2007-11-10 14:37:38 Re: [HACKERS] Connection Pools and DISCARD ALL

Browse pgsql-patches by date

  From Date Subject
Next Message Tom Lane 2007-11-10 18:19:31 Re: tsearch2api .. wrapper for integrated fultext
Previous Message Bruce Momjian 2007-11-10 14:37:38 Re: [HACKERS] Connection Pools and DISCARD ALL