bug in ts_rank_cd

Поиск
Список
Период
Сортировка
От Sushant Sinha
Тема bug in ts_rank_cd
Дата
Msg-id 1292938342.2327.8.camel@yoffice
обсуждение исходный текст
Список pgsql-hackers
There is a bug in ts_rank_cd. It does not correctly give rank when the
query lexeme is the first one in the tsvector.

Example:

select ts_rank_cd(to_tsvector('english', 'abc sdd'),
plainto_tsquery('english', 'abc'));
 ts_rank_cd
------------
          0

select ts_rank_cd(to_tsvector('english', 'bcg abc sdd'),
plainto_tsquery('english', 'abc'));
 ts_rank_cd
------------
        0.1

The problem is that the Cover finding algorithm ignores the lexeme at
the 0th position, I have attached a patch which fixes it. After the
patch the result is fine.

select ts_rank_cd(to_tsvector('english', 'abc sdd'), plainto_tsquery(
'english', 'abc'));
 ts_rank_cd
------------
        0.1


Вложения

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

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: SQL/MED - file_fdw
Следующее
От: Sushant Sinha
Дата:
Сообщение: bug in ts_rank_cd