LP#1549505: Scale popularity adjustment to relevance differently
authorMike Rylander <mrylander@gmail.com>
Sat, 19 Mar 2016 20:31:04 +0000 (16:31 -0400)
committerMike Rylander <mrylander@gmail.com>
Sat, 19 Mar 2016 20:31:04 +0000 (16:31 -0400)
commit5802e58bcac9d856f86451f32bb575de52069598
treeda4ff005912b55dd41e97c0a42efdaeeb6de0afe
parent1e450ccf90febed180d5e738db04467faded1a1b
LP#1549505: Scale popularity adjustment to relevance differently

From code comments:

$max_mult below is the value of the newly introduced global flag
called search.max_popularity_importance_multiplier.

$adjusted_scale below is the converted badge score scaling value
after accounting for the administrator-supplied $max_mult value.

This will cale the 0-5 effect of popularity badges by providing a
divisor for the badge average that is the inverse of the maximum
multiplier.  Two examples, comparing the effect to the default
$max_mult value of 2.0, which causes a $adjusted_scale value
of 5.0:

 * Given a $max_mult of 1.1, the value of $adjusted_scale
   will be 50.0, meaning that the average badge value will be
   /divided/ by 50.0 rather than 5.0, then added to 1.0 and
   used as a multiplier against the base relevance.  Thus a
   change of at most 10% to the base relevance for a record
   with a 5.0 average badge score. This will allow records
   that are naturally very relevant to avoid being pushed
   below badge-heavy records.

 * Given a $max_mult of 3.0, the value of $adjusted_scale
   will be 2.5, meaning that the average badge value will be
   /divided/ by 2.5 rather than 5.0, then added to 1.0 and
   used as a multiplier against the base relevance. Thus a
   change of as much as 200% to (or three times the size of)
   the base relevance for a record with a 5.0 average badge
   score.  This in turn will cause badges to outweigh
   relevance to a very large degree.

Signed-off-by: Mike Rylander <mrylander@gmail.com>
Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Driver/Pg/QueryParser.pm