pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: oliverfwales@gmail.com
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #18208: ts_headline MinWords and MaxWords cannot be set to the same value
Date: Mon, 20 Nov 2023 10:10:44 -0500
Message-ID: <1316294.1700493044@sss.pgh.pa.us> (raw)
In-Reply-To: <18208-c695b6b402c37727@postgresql.org>
References: <18208-c695b6b402c37727@postgresql.org>

PG Bug reporting form <noreply@postgresql.org> writes:
> Setting MaxWords and MinWords to the same value (e.g. 30) in the options of
> ts_headline throws the error "MinWords should be less than MaxWords". Is
> there any reason why they must be different? Why not allow setting them to
> the same value to allow a fixed number of words to be returned?

[ shrug... ] I'd turn that around: why would that be a good idea?
Usually, you want quite a bit of room between MinWords and MaxWords
to allow a more-or-less-apropos text snippet to be returned.
It seems highly unlikely that the calling query knows enough about
the right snippet length (in advance of knowing the match) to get
good results by demanding an exact length.

			regards, tom lane





view thread (2+ messages)

Message-ID: <1316294.1700493044@sss.pgh.pa.us>
Permalink:  ../1316294.1700493044@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/1316294.1700493044@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, oliverfwales@gmail.com, pgsql-bugs@lists.postgresql.org
  Subject: Re: BUG #18208: ts_headline MinWords and MaxWords cannot be set to the same value
  In-Reply-To: <1316294.1700493044@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