From 8107995ceedb7e80be87fc6aa31f747d993ab67e Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Mon, 2 Nov 2015 19:35:12 +0000 Subject: [PATCH] LP#1067823: tweak new identifier|genre index [1] Adjust facet XPath to work for more Pg versions. [2] Ensure that upgrade script adds stock search normalizers. [3] Make update script provide instructions for running a partial reingest. Signed-off-by: Galen Charlton Signed-off-by: Andrea Neiman Signed-off-by: Kathy Lussier --- Open-ILS/src/sql/Pg/950.data.seed-values.sql | 2 +- .../src/sql/Pg/upgrade/XXXX.data.genre-indexing.sql | 21 +++++++++++++++++++-- 2 files changed, 20 insertions(+), 3 deletions(-) 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 78c4d6c7e7..d87a203238 100644 --- a/Open-ILS/src/sql/Pg/950.data.seed-values.sql +++ b/Open-ILS/src/sql/Pg/950.data.seed-values.sql @@ -185,7 +185,7 @@ INSERT INTO config.metabib_field ( id, field_class, name, label, format, xpath, (32, 'series', 'browse', oils_i18n_gettext(32, 'Series Title (Browse)', 'cmf', 'label'), 'mods32', $$//mods32:mods/mods32:relatedItem[@type="series"]/mods32:titleInfo[@type="nfi"]$$, FALSE, '//@xlink:href', TRUE, $$*[local-name() != "nonSort"]$$ ); INSERT INTO config.metabib_field ( id, field_class, name, label, format, xpath, browse_field, facet_field, facet_xpath, joiner ) VALUES - (33, 'identifier', 'genre', oils_i18n_gettext(33, 'Genre', 'cmf', 'label'), 'marcxml', $$//marc:datafield[@tag='655' or @tag='659']$$, FALSE, TRUE, $$//*[contains('abvxyz',@code)]$$, ' -- ' ); -- /* to fool vim */; + (33, 'identifier', 'genre', oils_i18n_gettext(33, 'Genre', 'cmf', 'label'), 'marcxml', $$//marc:datafield[@tag='655' or @tag='659']$$, FALSE, TRUE, $$//*[local-name()='subfield' and contains('abvxyz',@code)]$$, ' -- ' ); -- /* to fool vim */; UPDATE config.metabib_field SET joiner = ' -- ' WHERE field_class = 'subject' AND name NOT IN ('name', 'complete'); diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.data.genre-indexing.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.data.genre-indexing.sql index f846288233..19f213d9ae 100644 --- a/Open-ILS/src/sql/Pg/upgrade/XXXX.data.genre-indexing.sql +++ b/Open-ILS/src/sql/Pg/upgrade/XXXX.data.genre-indexing.sql @@ -1,7 +1,24 @@ BEGIN; INSERT INTO config.metabib_field ( id, field_class, name, label, format, xpath, browse_field, facet_field, facet_xpath, joiner ) VALUES - (33, 'identifier', 'genre', oils_i18n_gettext(33, 'Genre', 'cmf', 'label'), 'marcxml', $$//marc:datafield[@tag='655' or @tag='659']$$, FALSE, TRUE, $$//*[contains('abvxyz',@code)]$$, ' -- ' ); -- /* to fool vim */; + (33, 'identifier', 'genre', oils_i18n_gettext(33, 'Genre', 'cmf', 'label'), 'marcxml', $$//marc:datafield[@tag='655' or @tag='659']$$, FALSE, TRUE, $$//*[local-name()='subfield' and contains('abvxyz',@code)]$$, ' -- ' ); -- /* to fool vim */; + +INSERT INTO config.metabib_field_index_norm_map (field,norm) + SELECT m.id, + i.id + FROM config.metabib_field m, + config.index_normalizer i + WHERE i.func IN ('search_normalize','split_date_range') + AND m.id IN (33); COMMIT; - + +\qecho +\qecho To use the new identifier|genre index, it is necessary to do +\qecho a partial reingest. For example, +\qecho +\qecho SELECT metabib.reingest_metabib_field_entries(record, FALSE, TRUE, FALSE) +\qecho FROM metabib.real_full_rec +\qecho WHERE tag IN (''''655'''', ''''659'''') +\qecho GROUP BY record; +\qecho -- 2.11.0