Re: Fragments in tsearch2 headline

From: Sushant Sinha <sushant354(at)gmail(dot)com>
To: Teodor Sigaev <teodor(at)sigaev(dot)ru>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Fragments in tsearch2 headline
Date: 2008-03-29 04:35:21
Message-ID: 1206765321.10128.25.camel@dragflick
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Ah I missed this email. I agree with Teodor that this is not the best
way to implement this functionality. At the time I was in a bit of hurry
to have something better than the default one and just hacked this. And
if we want to have this functionality across languages and parsers it
will be better to be implemented in the general framework.

The patch takes into account the corner case of overlap. Here is the
code for that
// start check
if (!startHL && *currentpos >= startpos)
startHL = 1;

The headline generation will not start until currentpos has gone past
startpos.

You can also check how this headline function is working at my website
indiankanoon.com. Some example queries are murder, freedom of speech,
freedom of press etc.

Should I develop the patch for the current cvs head of postgres?

Thanks,
-Sushant.

On Mon, 2008-03-17 at 22:00 +0300, Teodor Sigaev wrote:
> > Teodor, Oleg, do we want this?
> > http://archives.postgresql.org/pgsql-general/2007-11/msg00508.php
>
> I suppose, we want it. But there are a questions/issues:
> - Is it needed to introduce new function? may be it will be better to add option
> to existing headline function. I'd like to keep current layout: ts_headline
> provides some common interface to headline generation. Finding and marking
> fragments is deal of parser's headline method and generation of exact pieces of
> text is made by ts_headline.
> - Covers may be overlapped. So, overlapped fragments will be looked odd.
>
>
> In any case, the patch was developed for contrib version of tsearch.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message kevin kempter 2008-03-29 04:59:28 SQL question
Previous Message Brent Wood 2008-03-29 02:44:08 Re: Using tables in other PostGreSQL database