Full text search ranking: ordering using index and proximiti ranking with OR queries

Поиск
Список
Период
Сортировка
От Andrey Chursin
Тема Full text search ranking: ordering using index and proximiti ranking with OR queries
Дата
Msg-id CADfO6YJ2es1=RCwJQ2bik-U8rnpb+AoUheS_cOU5RRnkwJuKnA@mail.gmail.com
обсуждение исходный текст
Ответы Re: Full text search ranking: ordering using index and proximiti ranking with OR queries  (Nicolas Grilly <nicolas@gardentechno.com>)
Список pgsql-general
Hello

I have two unrelated questions about fts function ts_rank:

1) I've created GiST index on column with fts vector, but query
SELECT * FROM table ORDER BY ts_rank(field, :query) LIMIT 20
is perfomed with sequential table scan. Index was created on field
column. Does it mean FTS indexes does not support order by ranking? Or
I need somehow to create separated index for ranking?

2) I have a misunderstanding with proximity ranking work. Given two
vectors 'a:1 b:2' and 'a:1 b:1000', i am measuring ts_rank(vector, 'a'
| 'b'). And it is equal! But when i am replacing query with &
operator, e.g. asking for ts_rank(vector, 'a' & 'b') i am getting
different numbers. Why do I get proximity ranking only for AND fts
queries? This is a problem as far as to_tsquery produces OR queries,
so i need self-written postprocessing of query to replace OR with AND.

--
Regards,
Andrey

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

Предыдущее
От:
Дата:
Сообщение: Question on Rules
Следующее
От: Jerry Levan
Дата:
Сообщение: Re: Pokey Fedora Updates for Postgresql?