Re: BUG #15172: Postgresql ts_headline with <-> operator does not highlight text properly - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #15172: Postgresql ts_headline with <-> operator does not highlight text properly
Date
Msg-id 2425864.1698682991@sss.pgh.pa.us
Whole thread Raw
In response to Re: BUG #15172: Postgresql ts_headline with <-> operator does not highlight text properly  (Bruce Momjian <bruce@momjian.us>)
List pgsql-bugs
Bruce Momjian <bruce@momjian.us> writes:
> Sold!  :-)  Attached.

LGTM.

BTW, just for the OP's context: ts_headline was designed before
we had phrase search operators.  With only AND/OR/NOT, there
aren't any location restrictions on individual words.  (I recall
that we occasionally got complaints about how it shouldn't
highlight words that are supposed to NOT be there, but that was
an uncommon situation because normally you wouldn't be selecting
such a document to highlight.)  So both the function's basic
algorithm and its control parameters were designed without thought
for what to do if the query restricted match locations.  Maybe there's
a case for rethinking what it should do more than we already have;
but it's not clear that you can do much better without throwing out
the current set of control parameters as well as the algorithm.
See [1] for some context and discussion.

            regards, tom lane

[1] https://www.postgresql.org/message-id/flat/840.1669405935%40sss.pgh.pa.us



pgsql-bugs by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: BUG #15172: Postgresql ts_headline with <-> operator does not highlight text properly
Next
From: Andrei Lepikhov
Date:
Subject: Re: BUG #18170: Unexpected error: no relation entry for relid 3