Re: small bug in hlCover - Mailing list pgsql-hackers

From Sushant Sinha
Subject Re: small bug in hlCover
Date
Msg-id 1217822231.13402.8.camel@dragflick
Whole thread Raw
In response to small bug in hlCover  (Sushant Sinha <sushant354@gmail.com>)
List pgsql-hackers
On Mon, 2008-08-04 at 00:36 -0300, Euler Taveira de Oliveira wrote:
> Sushant Sinha escreveu:
> > I think there is a slight bug in hlCover function in wparser_def.c
> > 
> The bug is not in the hlCover. In prsd_headline, if we didn't find a 
> suitable bestlen (i.e. >= 0), than it includes up to document length or 
> *maxWords* (here is the bug). I'm attaching a small patch that fixes it 
> and some comment typos. Please apply it to 8_3_STABLE too.

Well hlCover purpose is to find a cover and for the document  '1 2 3 4 5
6 7 8 9 10' and the query '1'::tsquery, a cover exists. So it should
point it out.

On my source I see that prsd_headline marks only min_words which seems
like the right thing to do.

-Sushant.

> 
> euler=# select ts_headline('1 2 3 4 5 6 7 8 9 10','1'::tsquery, 
> 'MinWords=5');
>           ts_headline
> -----------------------------
>   <b>1</b> 2 3 4 5 6 7 8 9 10
> (1 registro)
> 
> euler=# select ts_headline('1 2 3 4 5 6 7 8 9 10','1'::tsquery);
>           ts_headline
> -----------------------------
>   <b>1</b> 2 3 4 5 6 7 8 9 10
> (1 registro)
> 
> 



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Instructions for adding new catalog
Next
From: Mark Kirkwood
Date:
Subject: Re: Mini improvement: statement_cost_limit