From: Mike Rylander Date: Thu, 22 Feb 2018 18:08:51 +0000 (-0500) Subject: LP#1744385: Add "Main Title" index definition and set reasonable defaults for virtual... X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=5d3b69c77c92f21308d7df6fae340a6f5acc2e33;p=evergreen%2Fmasslnc.git LP#1744385: Add "Main Title" index definition and set reasonable defaults for virtual weighting Signed-off-by: Mike Rylander Signed-off-by: Kathy Lussier Signed-off-by: Dan Wells --- 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 d7cd409d72..fb829c6c5c 100644 --- a/Open-ILS/src/sql/Pg/950.data.seed-values.sql +++ b/Open-ILS/src/sql/Pg/950.data.seed-values.sql @@ -327,6 +327,15 @@ VALUES ( TRUE, TRUE, FALSE ); +INSERT INTO config.metabib_field (id, field_class, name, format, weight, + label, xpath, display_field, search_field, browse_field, facet_field) +VALUES ( + 53, 'title', 'maintitle', 'marcxml', 10, + oils_i18n_gettext(53, 'Main Title', 'cmf', 'label'), + $$//*[@tag='245']/*[@code='a']$$, + FALSE, TRUE, FALSE, FALSE +); + INSERT INTO config.metabib_field_virtual_map (real, virtual) SELECT id, 45 @@ -335,6 +344,18 @@ INSERT INTO config.metabib_field_virtual_map (real, virtual) AND id NOT IN (15, 45) AND id NOT IN (SELECT real FROM config.metabib_field_virtual_map); +UPDATE config.metabib_field_virtual_map SET weight = -1 WHERE real = 39; +UPDATE config.metabib_field_virtual_map SET weight = 0 WHERE real = 41; +UPDATE config.metabib_field_virtual_map SET weight = 0 WHERE real = 42; +UPDATE config.metabib_field_virtual_map SET weight = 0 WHERE real = 46; +UPDATE config.metabib_field_virtual_map SET weight = 0 WHERE real = 47; +UPDATE config.metabib_field_virtual_map SET weight = 0 WHERE real = 48; +UPDATE config.metabib_field_virtual_map SET weight = 0 WHERE real = 50; +UPDATE config.metabib_field_virtual_map SET weight = 8 WHERE real = 6; +UPDATE config.metabib_field_virtual_map SET weight = 8 WHERE real = 8; +UPDATE config.metabib_field_virtual_map SET weight = 8 WHERE real = 16; +UPDATE config.metabib_field_virtual_map SET weight = 12 WHERE real = 53; + -- Modify existing config.metabib_field entries UPDATE config.metabib_field SET display_field = TRUE WHERE id IN ( diff --git a/Open-ILS/src/sql/Pg/upgrade/ZZZZ.data.virtual_index_defs.sql b/Open-ILS/src/sql/Pg/upgrade/ZZZZ.data.virtual_index_defs.sql index fb868f45de..491d009878 100644 --- a/Open-ILS/src/sql/Pg/upgrade/ZZZZ.data.virtual_index_defs.sql +++ b/Open-ILS/src/sql/Pg/upgrade/ZZZZ.data.virtual_index_defs.sql @@ -3,6 +3,15 @@ BEGIN; INSERT INTO config.metabib_field (id, field_class, name, label, browse_field) VALUES (45, 'keyword', 'blob', 'All searchable fields', FALSE); +INSERT INTO config.metabib_field (id, field_class, name, format, weight, + label, xpath, display_field, search_field, browse_field, facet_field) +VALUES ( + 53, 'title', 'maintitle', 'marcxml', 10, + oils_i18n_gettext(53, 'Main Title', 'cmf', 'label'), + $$//*[@tag='245']/*[@code='a']$$, + FALSE, TRUE, FALSE, FALSE +); + INSERT INTO config.metabib_field_virtual_map (real, virtual) SELECT id, 45 @@ -13,6 +22,18 @@ INSERT INTO config.metabib_field_virtual_map (real, virtual) UPDATE config.metabib_field SET xpath=$$//mods32:mods/mods32:subject[not(descendant::mods32:geographicCode)]$$ WHERE id = 16; +UPDATE config.metabib_field_virtual_map SET weight = -1 WHERE real = 39; +UPDATE config.metabib_field_virtual_map SET weight = 0 WHERE real = 41; +UPDATE config.metabib_field_virtual_map SET weight = 0 WHERE real = 42; +UPDATE config.metabib_field_virtual_map SET weight = 0 WHERE real = 46; +UPDATE config.metabib_field_virtual_map SET weight = 0 WHERE real = 47; +UPDATE config.metabib_field_virtual_map SET weight = 0 WHERE real = 48; +UPDATE config.metabib_field_virtual_map SET weight = 0 WHERE real = 50; +UPDATE config.metabib_field_virtual_map SET weight = 8 WHERE real = 6; +UPDATE config.metabib_field_virtual_map SET weight = 8 WHERE real = 8; +UPDATE config.metabib_field_virtual_map SET weight = 8 WHERE real = 16; +UPDATE config.metabib_field_virtual_map SET weight = 12 WHERE real = 53; + -- Stemming for genre INSERT INTO config.metabib_field_ts_map (metabib_field, ts_config) SELECT 33, 'english_nostop' WHERE NOT EXISTS (