use rank_cd to improve relevance ranking collab/gmcharlt/rel_2_0_rank_cd
authorMichael Peters <mrpeters@library.in.gov>
Wed, 25 May 2011 17:05:08 +0000 (13:05 -0400)
committerGalen Charlton <gmc@esilibrary.com>
Wed, 20 Jul 2011 15:55:56 +0000 (11:55 -0400)
commit94fefd52c4653c02cb03e6dec502ebf46d776f31
tree1349ad8638bb35e0043ca452bab43c6f245053cf
parent7d0b50fa1a273ba8ceaf4ea2770b73d02ca9fdb0
use rank_cd to improve relevance ranking

With the changes made to query parsing and searching in rel_2_0,
the relevance adjustment bumps specified in the search.relevance_adjustment
table can degrade search performance.  Removing all of the rows from
search.relevance_adjustment can improve search speed, but at the
cost of making relevance ranking problematic for some searches (e.g., as of
the date of this patch, doing a title search on "the help").

This patch implements a subset of the cover density ranking being introduced
in 2.1, specifically the following normalization options to rank_cd:

  2 divides the rank by the document length
  4 divides the rank by the mean harmonic distance between extents (this is implemented only by ts_rank_cd)
  8 divides the rank by the number of unique words in document

Original commit description from Mike Peters:
Patch to QueryParser.pm to fix search results sort order by rjackson courtesy of Steve Callender
[courtesy of Mike Rylander --gmc]

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Open-ILS/src/perlmods/OpenILS/Application/Storage/Driver/Pg/QueryParser.pm