Skip site navigation (1) Skip section navigation (2)

Fix for stop words in thesaurus file

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Oleg Bartunov <oleg(at)sai(dot)msu(dot)su>, Teodor Sigaev <teodor(at)sigaev(dot)ru>, PostgreSQL-patches <pgsql-patches(at)postgresql(dot)org>
Subject: Fix for stop words in thesaurus file
Date: 2007-11-09 02:32:09
Message-ID: 200711090232.lA92W9614295@momjian.us (view raw or flat)
Thread:
Lists: pgsql-committerspgsql-hackerspgsql-patches
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.

-- 
  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. +

Attachment: /pgpatches/ts_thesaurus
Description: text/x-diff (6.5 KB)

In response to

Responses

pgsql-hackers by date

Next:From: Bruce MomjianDate: 2007-11-09 02:50:45
Subject: Re: [HACKERS] Connection Pools and DISCARD ALL
Previous:From: Andrew DunstanDate: 2007-11-09 02:30:48
Subject: Re: How to determine if psql returns ZERO to the "shell" and finished successfully?

pgsql-committers by date

Next:From: Simon RiggsDate: 2007-11-09 08:35:17
Subject: Re: pgsql: If an index depends on no columns of itstable, give it a
Previous:From: Bruce MomjianDate: 2007-11-09 01:32:22
Subject: pgsql: In tsearch code, remove !(A && B) via restructuring, for clarity

pgsql-patches by date

Next:From: Bruce MomjianDate: 2007-11-09 02:50:45
Subject: Re: [HACKERS] Connection Pools and DISCARD ALL
Previous:From: Jan UrbaƄskiDate: 2007-11-09 01:22:34
Subject: a tsearch2 (8.2.4) dictionary that only filters out stopwords

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group