pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Bruce Momjian <bruce@momjian.us>
Cc: Alex Malek <magicagent@gmail.com>
Cc: pgsql-bugs@lists.postgresql.org
Cc: ngigi@at.co.ke
Subject: Re: BUG #15172: Postgresql ts_headline with <-> operator does not highlight text properly
Date: Mon, 30 Oct 2023 12:23:11 -0400
Message-ID: <2425864.1698682991@sss.pgh.pa.us> (raw)
In-Reply-To: <ZT_TJtM0BsE5l-t7@momjian.us>
References: <152461454026.19805.6310947081647212894@wrigleys.postgresql.org>
	<CAGH8cccS-9yb1VkgUTAaghz4P3aL8DneH_24bN7Y0LCLO8by1Q@mail.gmail.com>
	<ZT1kGIbiALGclTUA@momjian.us>
	<1995601.1698526000@sss.pgh.pa.us>
	<ZT2akojpqo9rLiV_@momjian.us>
	<2140529.1698594815@sss.pgh.pa.us>
	<ZT-rD8Uhn-RK6pal@momjian.us>
	<2420641.1698679946@sss.pgh.pa.us>
	<ZT_TJtM0BsE5l-t7@momjian.us>

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





view thread (13+ messages)  latest in thread

Message-ID: <2425864.1698682991@sss.pgh.pa.us>
Permalink:  ../2425864.1698682991@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/2425864.1698682991@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, bruce@momjian.us, magicagent@gmail.com, pgsql-bugs@lists.postgresql.org, ngigi@at.co.ke
  Subject: Re: BUG #15172: Postgresql ts_headline with <-> operator does not highlight text properly
  In-Reply-To: <2425864.1698682991@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox