Документ взят из кэша поисковой машины. Адрес
оригинального документа
: http://www.sai.msu.su/~megera/postgres/gist/tsearch/V2/docs/oscon_tsearch2/rank_cd.html
Дата изменения: Unknown Дата индексирования: Sat Dec 22 10:27:39 2007 Кодировка: Поисковые слова: m 45 |
Previous | Next |
Function rank_cdReturns a rank value using a cover density algorithm that penalizes search words that are far apart. rank_cd([ k INT4, ] tsv TSVECTOR, tsq TSQUERY [, normalization INT4]) RETURNS FLOAT4
SELECT set_curcfg('default_english'); set_curcfg ------------ (1 row) SELECT file, title, rank_cd(ts_vec, to_tsquery('create & schema')) FROM postgresql_manual WHERE ts_vec @@ to_tsquery('create & schema') ORDER BY rank_cd(ts_vec, to_tsquery('create & schema')) DESC LIMMIT 5; file | title | rank_cd -------------------------+-----------------+--------- sql-createschema.html | CREATE SCHEMA | 44.5817 ddl-schemas.html | Schemas | 30.2858 bookindex.html | Index | 12.1279 sql-createsequence.html | CREATE SEQUENCE | 6.92208 sql-grant.html | GRANT | 6.56535 (5 rows) SELECT file, title, rank_cd(1, ts_vec, to_tsquery('create & schema')) FROM postgresql_manual WHERE ts_vec @@ to_tsquery('create & schema') ORDER BY rank_cd(1, ts_vec, to_tsquery('create & schema')) DESC LIMIT 5; file | title | rank_cd -------------------------+-----------------+--------- sql-createschema.html | CREATE SCHEMA | 16.3121 ddl-schemas.html | Schemas | 9.40478 bookindex.html | Index | 4.53197 sql-createsequence.html | CREATE SEQUENCE | 2.06385 sql-createtable.html | CREATE TABLE | 1.82864 (5 rows) |