Re: [GENERAL] Fragments in tsearch2 headline

From: Sushant Sinha <sushant354(at)gmail(dot)com>
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>, Pierre-Yves Strub <pierre(dot)yves(dot)strub(at)gmail(dot)com>, Pgsql Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [GENERAL] Fragments in tsearch2 headline
Date: 2009-04-14 01:18:50
Message-ID: 1239671930.6379.3.camel@dragflick
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

Headline generation uses hlCover to get fragments in text with *all*
query items. In case there is no such fragment, it does not return
anything.

What you are asking will either require returning *maximally* matching
covers or handling it as a separate case.

-Sushant.

On Mon, 2009-04-13 at 20:57 -0400, Tom Lane wrote:
> Sushant Sinha <sushant354(at)gmail(dot)com> writes:
> > Sorry for the delay. Here is the patch with FragmentDelimiter option.
> > It requires an extra option in HeadlineParsedText and uses that option
> > during generateHeadline.
>
> I did some editing of the documentation for this patch and noticed that
> the explanation of the fragment-based headline method says
>
> If not all query words are found in the
> document, then a single fragment of the first <literal>MinWords</>
> in the document will be displayed.
>
> (That's what it says now, that is, based on my editing and testing of
> the original.) This seems like a pretty dumb fallback approach ---
> if you have only a partial match, the headline generation suddenly
> becomes about as stupid as it could possibly be. I could understand
> doing the above if the text actually contains *none* of the query
> words, but surely if it contains some of them we should still select
> fragments centered on those words.
>
> regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2009-04-14 01:24:58 Re: [GENERAL] Fragments in tsearch2 headline
Previous Message Tom Lane 2009-04-14 00:57:07 Re: [GENERAL] Fragments in tsearch2 headline

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2009-04-14 01:24:58 Re: [GENERAL] Fragments in tsearch2 headline
Previous Message Tom Lane 2009-04-14 00:57:07 Re: [GENERAL] Fragments in tsearch2 headline