From 6d176feb4e4bbfc67e9c4179cd7e446fd148fd4d Mon Sep 17 00:00:00 2001 From: Kathy Lussier Date: Tue, 23 Aug 2016 16:01:35 -0400 Subject: [PATCH] LP#1614237: Popularity badge seed data Adding popularity badge seed data for a badge based on Holds Requested over the past 5 years. Signed-off-by: Kathy Lussier Signed-off-by: Mike Rylander --- Open-ILS/src/sql/Pg/950.data.seed-values.sql | 4 ++++ .../src/sql/Pg/upgrade/XXXX.data.popularity-badge-seed-data.sql | 8 ++++++++ docs/RELEASE_NOTES_NEXT/OPAC/popularity-rating.txt | 3 +++ 3 files changed, 15 insertions(+) create mode 100644 Open-ILS/src/sql/Pg/upgrade/XXXX.data.popularity-badge-seed-data.sql diff --git a/Open-ILS/src/sql/Pg/950.data.seed-values.sql b/Open-ILS/src/sql/Pg/950.data.seed-values.sql index b21fe2a817..dbbbdde49a 100644 --- a/Open-ILS/src/sql/Pg/950.data.seed-values.sql +++ b/Open-ILS/src/sql/Pg/950.data.seed-values.sql @@ -5129,6 +5129,10 @@ INSERT INTO actor.org_unit_setting (org_unit, name, value) VALUES ( ,(1, 'circ.grace.extend', 'true') ; +--220.schema.rating.sql (Default badge for popularity ranking) +INSERT INTO rating.badge (name, description, scope, weight, horizon_age, importance_age, importance_interval, importance_scale, recalc_interval, popularity_parameter, percentile) + VALUES('Top Holds Over Last 5 Years', 'The top 97th percentile for holds requested over the past five years on all materials. More weight is given to holds requested over the last year, with importance decreasing for every year after that.', 1, 3, '5 years', '5 years', '1 year', 2, '1 day', 2, 97); + -- Staged Search (for default matchpoints) INSERT INTO search.relevance_adjustment (field, bump_type, multiplier) VALUES(1, 'first_word', 1.5); diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.data.popularity-badge-seed-data.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.data.popularity-badge-seed-data.sql new file mode 100644 index 0000000000..61f911856f --- /dev/null +++ b/Open-ILS/src/sql/Pg/upgrade/XXXX.data.popularity-badge-seed-data.sql @@ -0,0 +1,8 @@ +BEGIN; + +-SELECT evergreen.upgrade_deps_block_check('xxxx', :eg_version); + +INSERT INTO rating.badge (name, description, scope, weight, horizon_age, importance_age, importance_interval, importance_scale, recalc_interval, popularity_parameter, percentile) + VALUES('Top Holds Over Last 5 Years', 'The top 97th percentile for holds requested over the past five years on all materials. More weight is given to holds requested over the last year, with importance decreasing for every year after that.', 1, 3, '5 years', '5 years', '1 year', 2, '1 day', 2, 97); + +COMMIT; diff --git a/docs/RELEASE_NOTES_NEXT/OPAC/popularity-rating.txt b/docs/RELEASE_NOTES_NEXT/OPAC/popularity-rating.txt index 6383fd5882..bd88ac8a37 100644 --- a/docs/RELEASE_NOTES_NEXT/OPAC/popularity-rating.txt +++ b/docs/RELEASE_NOTES_NEXT/OPAC/popularity-rating.txt @@ -50,10 +50,13 @@ All popularity badge definitions will describe a set of configuration, populatio ** Bibliographic Record Age (days) ** Publication Age (days) ** Available On-Line (for e-books, etc) +** Copy Count * *Fixed Rating:* An optional override supplying a fixed popularity value for all records earning this badge. For some popularity types, such as "Available On-Line", it is preferable to specify, rather than calculate, the popularity value for a badge. This is presented as a number spinner with a value ranging from 1 to 5. * *Inclusion Threshold Percentile:* Cumulative distribution percentile. This is presented as a number spinner of "percentile" values ranging from 50 to 100, indicating the number of how much of the population a record's score must be better than in order to earn the badge. Leaving this value unset will allow the entire population to earn the badge. * *Discard most common:* A value that, if greater than 0, will ignore records with extremely common values so that outliers are more readily identified, and the distribution of values can be assumed to be more normal. Many popularity parameters, such as those for circulation counts, benefit from this input filter. This is presented as a number spinner initially set to 0 that indicates the number of distinct, low values -- but not the values themselves -- to exclude from the population. +This new feature comes with a starter badge based on the top 97th percentile of holds requested over the past five years. + A word about Inclusion Threshold Percentile +++++++++++++++++++++++++++++++++++++++++++ -- 2.11.0