Re: [GENERAL] Fragments in tsearch2 headline - Mailing list pgsql-hackers

From Sushant Sinha
Subject Re: [GENERAL] Fragments in tsearch2 headline
Date
Msg-id 1239671930.6379.3.camel@dragflick
Whole thread Raw
In response to Re: [GENERAL] Fragments in tsearch2 headline  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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@gmail.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



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: [GENERAL] Fragments in tsearch2 headline
Next
From: David Fetter
Date:
Subject: Re: psql with "Function Type" in \df