1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-31 22:04:40 +03:00

Significantly improve ranking:

1) rank_cd now use weight of lexemes
2) rank_cd and rank can use any combination of normalization methods:
        no normalization
        normalization by log(length of document)
        -----/------- by length of document
        -----/------- by number of unique word in document
        -----/------- by log(number of unique word in document)
        -----/------- by number of covers (only rank_cd)

Improve cover's search.

TODO: changes in documentation
This commit is contained in:
Teodor Sigaev
2006-03-02 19:07:19 +00:00
parent 85fa9f516c
commit 38c4fe87ac
3 changed files with 162 additions and 93 deletions

View File

@ -2315,9 +2315,9 @@ An hour of storm to place
The sculpture of these granite seams,
Upon a woman s face. E. J. Pratt (1882 1964)
'), to_tsquery('sea&thousand&years'));
rank_cd
---------
1.2
rank_cd
-----------
0.0555556
(1 row)
select rank_cd(to_tsvector('Erosion It took the sea a thousand years,
@ -2329,9 +2329,9 @@ An hour of storm to place
The sculpture of these granite seams,
Upon a woman s face. E. J. Pratt (1882 1964)
'), to_tsquery('granite&sea'));
rank_cd
----------
0.880303
rank_cd
-----------
0.0238095
(1 row)
select rank_cd(to_tsvector('Erosion It took the sea a thousand years,
@ -2345,7 +2345,7 @@ Upon a woman s face. E. J. Pratt (1882 1964)
'), to_tsquery('sea'));
rank_cd
---------
2
0.2
(1 row)
select get_covers(to_tsvector('Erosion It took the sea a thousand years,