Re: BUG #8354: stripped positions can generate nonzero rank in ts_rank_cd

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Alexander Hill <alex(at)hill(dot)net(dot)au>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #8354: stripped positions can generate nonzero rank in ts_rank_cd
Date: 2014-03-24 18:37:30
Message-ID: 20140324183730.GD15836@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Fri, Mar 21, 2014 at 06:10:15PM -0400, Bruce Momjian wrote:
> On Fri, Mar 21, 2014 at 10:45:18AM -0400, Tom Lane wrote:
> > Bruce Momjian <bruce(at)momjian(dot)us> writes:
> > > OK, combined patch attached. Is this correct? I keep hoping someone
> > > else will chime in with an opinion on this, but at this point I think
> > > what you have done is clear enough for me to commit for 9.4.
> >
> > That whole function is seriously undercommented; I suppose it's not this
> > patch's charter to fix that, but we could at least write
> >
> > ! /* ignore words without positions */
> > ! entry++;
> > ! continue;
> >
> > The proposed new documentation text seems pretty badly written. How about
> >
> > This function requires lexeme positional information to perform its
> > calculation. Therefore it ignores any <quote>stripped</> lexemes in the
> > <type>tsvector</>. If there are no unstripped lexemes in the input, the
> > result will be zero.
> >
> > The parenthetical "See" text is ok.
>
> OK, thanks. Updated patch attached. If Alexander Hill would like to
> add more C comments to any of the ts*.c files, or docs explaining what
> "cover desity" is, I would be glad to include those in the patch as
> well.

Patch applied with this commit message:

Fix ts_rank_cd() to ignore stripped lexemes

Previously, stripped lexemes got a default location and could be
considered if mixed with non-stripped lexemes.

BACKWARD INCOMPATIBILITY CHANGE

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

+ Everyone has their own god. +

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Bruce Momjian 2014-03-24 19:49:56 Re: BUG #8354: stripped positions can generate nonzero rank in ts_rank_cd
Previous Message Magnus Hagander 2014-03-24 13:45:37 Re: Bug in PostgreSQL locking mechanism or misunderstanding of the mechanism