Simon Riggs <simon@2ndquadrant.com> writes:
> http://developer.postgresql.org/pgdocs/postgres/textsearch-controls.html
> Ranking Search Results
> shows and example which says
> "This is the same example using normalized ranking"
> and then gives a query which calculates normalization in an incorrect
> manner,
On what basis do you claim that's an incorrect manner? It's exactly
what is described in the paragraph just before the examples.
> A correct example
> would be something like this:
> SELECT title, ts_rank_cd(textsearch, query, 8 /*Normalization*/) AS rank
Why is that correct (or more correct than other ways)?
> - Can we say what the differences are between the two ranking functions?
> Why do we have two?
We already say that: the _cd function doesn't work without positional
info in the input tsvector.
regards, tom lane