[DOCS] Explain the difference between ts_rank and ts_rank_cd

Поиск
Список
Период
Сортировка
От hmidi slim
Тема [DOCS] Explain the difference between ts_rank and ts_rank_cd
Дата
Msg-id CAMsqVxs-ozWnm3KEFgfiKDPtq77SK8FNAXykpmxTvjub8RSjKQ@mail.gmail.com
обсуждение исходный текст
Список pgsql-docs
According to the official documentation of a postgresql, the difference between the function ts_rank and ts_rank_cd is not clear.
According to the documentation:
ts_rank ranks vectors based on the frequency of their matching lexemes.
And ts_rank_cd :
This function computes the cover density ranking for the given document vector and query. Cover density is similar to ts_rankranking except that the proximity of matching lexemes to each other is taken into consideration.

But when trying some examples:

SELECT ts_rank( to_tsvector('name lastname name lastname'), to_tsquery('name & lastname'));

ts_rank:0,3400053
SELECT ts_rank( to_tsvector('name lastname zzzzzzzz tttttt name lastname'), to_tsquery('name & lastname'));


ts_rank:0,3344279
SELECT ts_rank( to_tsvector('name lastname xxxxx yyyyyyy zzzzzzzz tttttt name lastname'), to_tsquery('name & lastname'));


ts_rank:0,3187879

Based to these results I found that even the ts_rank maybe uses the proximity of matching lexemes which is a feature of ts_rank_cd.

Could you provide us some more examples fo the different ranking functions and what is the difference between them? 

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

Предыдущее
От: hmidi slim
Дата:
Сообщение: [DOCS] What's the difference between the ts_rank and ts_rank_cd?
Следующее
От: Peter Eisentraut
Дата:
Сообщение: Re: [DOCS] backpatching documentation after conversion to XML