From: dbs Date: Sat, 5 Mar 2011 03:14:47 +0000 (+0000) Subject: Correct search index definitions for subject|complete and identifier|bibcn X-Git-Tag: kcls-grey-screen-prod1~2^2~55 X-Git-Url: http://git.equinoxoli.org/?p=evergreen-equinox.git;a=commitdiff_plain;h=da4f18561b2e036dc2394634abf496ef91ced2b3 Correct search index definitions for subject|complete and identifier|bibcn Dan Wells reported in LP# 729385 that the index definitions for subject|complete and identifier|bibcn were not working, and traced the problem to a change in how indexes are generated in 2.0+. Dropping the trailing '//text()' on these two indexes addresses the problem. Sites upgrading from a previous version of Evergreen 2.0 will want to refresh the indexes after applying this schema change to enable searches against subject|complete and identifier|bibcn to work. git-svn-id: svn://svn.open-ils.org/ILS/trunk@19587 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/src/sql/Pg/002.schema.config.sql b/Open-ILS/src/sql/Pg/002.schema.config.sql index ee70d36..68bf85d 100644 --- a/Open-ILS/src/sql/Pg/002.schema.config.sql +++ b/Open-ILS/src/sql/Pg/002.schema.config.sql @@ -70,7 +70,7 @@ CREATE TABLE config.upgrade_log ( install_date TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW() ); -INSERT INTO config.upgrade_log (version) VALUES ('0493'); -- dbs +INSERT INTO config.upgrade_log (version) VALUES ('0494'); -- dbs CREATE TABLE config.bib_source ( id SERIAL PRIMARY KEY, 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 ad5dbb2..d330929 100644 --- a/Open-ILS/src/sql/Pg/950.data.seed-values.sql +++ b/Open-ILS/src/sql/Pg/950.data.seed-values.sql @@ -62,7 +62,7 @@ INSERT INTO config.metabib_field ( id, field_class, name, label, format, xpath, INSERT INTO config.metabib_field ( id, field_class, name, label, format, xpath ) VALUES (15, 'keyword', 'keyword', oils_i18n_gettext(15, 'General Keywords', 'cmf', 'label'), 'mods32', $$//mods32:mods/*[not(local-name()='originInfo')]$$ ); -- /* to fool vim */; INSERT INTO config.metabib_field ( id, field_class, name, label, format, xpath ) VALUES - (16, 'subject', 'complete', oils_i18n_gettext(16, 'All Subjects', 'cmf', 'label'), 'mods32', $$//mods32:mods/mods32:subject//text()$$ ); + (16, 'subject', 'complete', oils_i18n_gettext(16, 'All Subjects', 'cmf', 'label'), 'mods32', $$//mods32:mods/mods32:subject$$ ); INSERT INTO config.metabib_field ( id, field_class, name, label, format, xpath ) VALUES (17, 'identifier', 'accession', oils_i18n_gettext(17, 'Accession Number', 'cmf', 'label'), 'marcxml', $$//marc:controlfield[@tag='001']$$ ); @@ -81,7 +81,7 @@ INSERT INTO config.metabib_field ( id, field_class, name, label, format, xpath ) INSERT INTO config.metabib_field ( id, field_class, name, label, format, xpath ) VALUES (24, 'identifier', 'sici', oils_i18n_gettext(24, 'SICI', 'cmf', 'label'), 'marcxml', $$//marc:datafield[@tag='024' and ind1='4']/marc:subfield[@code='a' or @code='z']$$ ); INSERT INTO config.metabib_field ( id, field_class, name, label, format, xpath ) VALUES - (25, 'identifier', 'bibcn', oils_i18n_gettext(25, 'Local Free-Text Call Number', 'cmf', 'label'), 'marcxml', $$//marc:datafield[@tag='099']//text()$$ ); + (25, 'identifier', 'bibcn', oils_i18n_gettext(25, 'Local Free-Text Call Number', 'cmf', 'label'), 'marcxml', $$//marc:datafield[@tag='099']$$ ); INSERT INTO config.metabib_field ( id, field_class, name, label, format, xpath ) VALUES (26, 'identifier', 'tcn', oils_i18n_gettext(26, 'Title Control Number', 'cmf', 'label'), 'marcxml', $$//marc:datafield[@tag='901']/marc:subfield[@code='a']$$ ); INSERT INTO config.metabib_field ( id, field_class, name, label, format, xpath ) VALUES diff --git a/Open-ILS/src/sql/Pg/upgrade/0494.data.search_indexes.sql b/Open-ILS/src/sql/Pg/upgrade/0494.data.search_indexes.sql new file mode 100644 index 0000000..79ebb44 --- /dev/null +++ b/Open-ILS/src/sql/Pg/upgrade/0494.data.search_indexes.sql @@ -0,0 +1,13 @@ +BEGIN; + +INSERT INTO config.upgrade_log (version) VALUES ('0494'); -- dbs + +UPDATE config.metabib_field + SET xpath = $$//mods32:mods/mods32:subject$$ + WHERE field_class = 'subject' AND name = 'complete'; + +UPDATE config.metabib_field + SET xpath = $$//marc:datafield[@tag='099']$$ + WHERE field_class = 'identifier' AND name = 'bibcn'; + +COMMIT;