Re: BUG #19960: Phrase search matches when it should not: phrase positions wrap at 16383

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: shihao zhong <zhong950419(at)gmail(dot)com>
Cc: james(dot)moore(at)g5labs(dot)ai, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #19960: Phrase search matches when it should not: phrase positions wrap at 16383
Date: 2026-12-05 20:46:31
Message-ID: 318315.1796503591@sss.pgh.pa.us
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

shihao zhong <zhong950419(at)gmail(dot)com> writes:
> I can reproduce this on 15 through 19. A negated left side such as
> '(!(b <-> c) & a) <-> d' hits it too. The attached patch clamps the
> computed positions to 16383, as tsvector_concat() already does.

Agreed, good catch.

We really need to look into relaxing the positions limit. I think
clamping to 16K was only marginally reasonable before we invented
the phrase-distance operator, and it's really horrid since then,
because it basically breaks <-> checks on any moderately-large
document. But in the meantime we need this.

regards, tom lane

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message shihao zhong 2026-12-05 21:57:55 Re: BUG #19960: Phrase search matches when it should not: phrase positions wrap at 16383
Previous Message shihao zhong 2026-12-05 20:26:11 Re: BUG #19960: Phrase search matches when it should not: phrase positions wrap at 16383