BUG #17569: false negative / positive results when using <-> (followed by) and tsvector limit (16383) hit

Поиск
Список
Период
Сортировка
От PG Bug reporting form
Тема BUG #17569: false negative / positive results when using <-> (followed by) and tsvector limit (16383) hit
Дата
Msg-id 17569-47d11a72a38bf8ae@postgresql.org
обсуждение исходный текст
Список pgsql-bugs
The following bug has been logged on the website:

Bug reference:      17569
Logged by:          Alex Malek
Email address:      magicagent@gmail.com
PostgreSQL version: 14.4
Operating system:   Red Hat
Description:

It is well documented that "Position values in tsvector must be greater than
0 and no more than 16,383"

However these limits can result in false positive or false negative search
results 
doing a FOLLOWED BY / phrase search in a document w/ more than 16,383
words.

The false negative seems particularly bad / unexpected.

The false positive results happen when a word is at or before before
position 16,382, then every word at or past position 16,383 appears to be at
16,383

SELECT tq, text, text @@ tq AS ok,  repeat(' foo ',16381) || text @@ tq AS
false_pos
FROM (VALUES( websearch_to_tsquery('"red cat"'), 'red dogs chase with black
cats' )) t(tq, text) ;
       tq        |              text              | ok | false_pos
-----------------+--------------------------------+----+-----------
 'red' <-> 'cat' | red dogs chase with black cats | f  | t
(1 row)

The false negative happens for any phrase that exists at or after position
16,383 since all words appear to be at 16,383

# SELECT tq, text, text @@ tq AS small,  repeat(' foo ',16381) || text @@ tq
AS false_neg
FROM (VALUES( websearch_to_tsquery('"black cat"'), 'red dogs chase with
black cats' )) t(tq, text) ;
        tq         |              text              | small | false_neg
-------------------+--------------------------------+-------+-----------
 'black' <-> 'cat' | red dogs chase with black cats | t     | f
(1 row)


В списке pgsql-bugs по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: BUG #17564: Planner bug in combination of generate_series(), unnest() and ORDER BY
Следующее
От: Alex Malek
Дата:
Сообщение: Re: BUG #15172: Postgresql ts_headline with <-> operator does not highlight text properly