[PATCH] fix GIN index search sometimes losing results
Pavel Borisov <pashkin.elfe@gmail.com>
From: Pavel Borisov <pashkin.elfe@gmail.com>
To: pgsql-hackers@lists.postgresql.org
Date: 2020-05-07T13:26:17Z
Lists: pgsql-hackers
Attachments
- gin-weights-patch-v3.diff (application/octet-stream) patch v3
Hi, all It appeared than GIN index sometimes lose results if simultaneously: 1 if query operand contains weight marks 2 if weight-marked operand is negated by ! operator 3 if there are only logical (not phrase) operators from this negation towards the root of query tree. e.g. '!crew:A'::tsquery refuse to find 'crew:BCD'::tsvector Seems it is in all versions of PG. The patch is intended to deal with the issue. Also it contains tests for these rare condition. Pavel Borisov.
Commits
-
Replace TS_execute's TS_EXEC_CALC_NOT flag with TS_EXEC_SKIP_NOT.
- 79d6d1a277ee 14.0 landed
- 70eca6a9a6df 13.0 landed
-
Fix assorted bugs by changing TS_execute's callback API to ternary logic.
- 92fe6895d66d 13.0 landed
- 2f2007fbb255 14.0 landed