From: | Sushant Sinha <sushant354(at)gmail(dot)com> |
---|---|
To: | Bruce Momjian <bruce(at)momjian(dot)us> |
Cc: | Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>, Alvaro Herrera <alvherre(at)commandprompt(dot)com>, pgsql-hackers(at)postgresql(dot)org, Teodor Sigaev <teodor(at)sigaev(dot)ru> |
Subject: | Re: text search patch status update? |
Date: | 2009-01-08 02:42:05 |
Message-ID: | 1231382525.8322.17.camel@dragflick |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
The default headline generation function is complicated. It checks a lot
of cases to determine the best headline to be displayed. So Heikki's
examples just say that headline generation function may not be very
intuitive. However, his examples were not affected by the bug.
Because of the bug, hlcover was not returning a cover when the query
item was the first lexeme in the text. And so the headline generation
function will return just MINWORDS rather than the actual headline as
per the logic.
After the patch you will see the difference in the example:
http://archives.postgresql.org/pgsql-hackers/2008-07/msg00785.php
-Sushant.
On Wed, 2009-01-07 at 20:50 -0500, Bruce Momjian wrote:
> Uh, where are we on this? I see the same output in CVS HEAD as Heikki,
> and I assume he thought at least one of them was wrong. ;-)
>
> ---------------------------------------------------------------------------
>
> Heikki Linnakangas wrote:
> > Sushant Sinha wrote:
> > > Patch #2. I think this is a straigt forward bug fix.
> >
> > Yes, I think you're right. In hlCover(), *q is 0 when the only match is
> > the first item in the text, and we shouldn't bail out with "return
> > false" in that case.
> >
> > But there seems to be something else going on here as well:
> >
> > postgres=# select ts_headline('1 2 3 4 5', '2'::tsquery, 'MinWords=2,
> > MaxWords=3');
> > ts_headline
> > --------------
> > <b>2</b> 3 4
> > (1 row)
> >
> > postgres=# select ts_headline('aaa1 aaa2 aaa3 aaa4
> > aaa5','aaa2'::tsquery, 'MinWords=2, MaxWords=3');
> > ts_headline
> > ------------------
> > <b>aaa2</b> aaa3
> > (1 row)
> >
> > In the first example, you get three words, and in the 2nd, just two. It
> > must be because of the default ShortWord setting of 3. Also, if only the
> > last word matches, and it's a "short word", you get the whole text:
> >
> > postgres=# select ts_headline('1 2 3 4 5','5'::tsquery, 'MinWords=2,
> > MaxWords=3');
> > ts_headline
> > ------------------
> > 1 2 3 4 <b>5</b>
> > (1 row)
> >
> > --
> > Heikki Linnakangas
> > EnterpriseDB http://www.enterprisedb.com
> >
> > --
> > Sent via pgsql-hackers mailing list (pgsql-hackers(at)postgresql(dot)org)
> > To make changes to your subscription:
> > http://www.postgresql.org/mailpref/pgsql-hackers
>
From | Date | Subject | |
---|---|---|---|
Next Message | Alvaro Herrera | 2009-01-08 02:44:52 | Re: Updates of SE-PostgreSQL 8.4devel patches (r1389) |
Previous Message | Stephen Frost | 2009-01-08 02:13:58 | Re: New patch for Column-level privileges |