Re: Ellipses around result fragment of ts_headline - Mailing list pgsql-hackers

From Sushant Sinha
Subject Re: Ellipses around result fragment of ts_headline
Date
Msg-id 1234645590.6298.3.camel@dragflick
Whole thread Raw
In response to Ellipses around result fragment of ts_headline  (Asher Snyder <asnyder@noloh.com>)
Responses Re: Ellipses around result fragment of ts_headline  (Asher Snyder <asnyder@noloh.com>)
Re: Ellipses around result fragment of ts_headline  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
I think we currently do that. We add ellipses only when we encounter a
new fragment. So there should not be ellipses if we are at the end of
the document or if that is the first fragment (includes the beginning of
the document). Here is the code in generateHeadline, ts_parse.c that
adds the ellipses:
           if (!infrag)           {
               /* start of a new fragment */               infrag = 1;               numfragments ++;               /*
adda fragment delimitor if this is after the first
 
one */               if (numfragments > 1)               {                   memcpy(ptr, prs->fragdelim,
prs->fragdelimlen);                  ptr += prs->fragdelimlen;               }
 
           }

It is possible that there is a bug that needs to be fixed. Can you show
me an example where you found that?

-Sushant.




On Sat, 2009-02-14 at 15:13 -0500, Asher Snyder wrote:
> It would be very useful if there were an option to have ts_headline append
> ellipses before or after a result fragement based on the position of the
> fragment in the source document. For instance, when running ts_headline(doc,
> query) it will correctly return a fragment with words highlighted, however,
> there's no easy way to determine whether this returned fragment is at the
> beginning or end of the original doc, and add the necessary ellipses. 
> 
> Searches such as postgresql.org ALWAYS add ellipses before or after the
> fragment regardless of whether or not ellipses are warranted. In my opinion
> always adding ellipses to the fragment is deceptive to the user, in many of
> my search result cases, the fragment is at the beginning of the doc, and
> would confuse the user to always see ellipses. So you can see how useful the
> feature described above would be beneficial to the accuracy of the search
> result fragment.
> 
> 
> 
> 
> 



pgsql-hackers by date:

Previous
From: Asher Snyder
Date:
Subject: Ellipses around result fragment of ts_headline
Next
From: Asher Snyder
Date:
Subject: Re: Ellipses around result fragment of ts_headline