Re: Normalized Ranking example incorrect in text search - Mailing list pgsql-docs

From Tom Lane
Subject Re: Normalized Ranking example incorrect in text search
Date
Msg-id 11802.1195069042@sss.pgh.pa.us
Whole thread Raw
In response to Normalized Ranking example incorrect in text search  (Simon Riggs <simon@2ndquadrant.com>)
Responses Re: Normalized Ranking example incorrect in text search  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-docs
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

pgsql-docs by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Obsolete references to GBorg in documentation
Next
From: Tom Lane
Date:
Subject: Re: Normalized Ranking example incorrect in text search