Re: BUG #18208: ts_headline MinWords and MaxWords cannot be set to the same value

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: oliverfwales(at)gmail(dot)com
Cc: pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #18208: ts_headline MinWords and MaxWords cannot be set to the same value
Date: 2023-11-20 15:10:44
Message-ID: 1316294.1700493044@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

PG Bug reporting form <noreply(at)postgresql(dot)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

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2023-11-20 15:16:34 Re: B-tree Index corruption
Previous Message Filip Sedlák 2023-11-20 15:08:39 B-tree Index corruption