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. -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers