From 392a45cfd6f61618c3b7b72a5721c379299e26c9 Mon Sep 17 00:00:00 2001 From: miker Date: Fri, 6 Aug 2010 18:12:14 +0000 Subject: [PATCH] Index the internal bib id and tcn value to make searching simpler git-svn-id: svn://svn.open-ils.org/ILS/trunk@17120 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/src/sql/Pg/002.schema.config.sql | 2 +- Open-ILS/src/sql/Pg/950.data.seed-values.sql | 6 ++++++ .../src/sql/Pg/upgrade/0363.data.index-tcn-and-bibid.sql | 13 +++++++++++++ 3 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 Open-ILS/src/sql/Pg/upgrade/0363.data.index-tcn-and-bibid.sql diff --git a/Open-ILS/src/sql/Pg/002.schema.config.sql b/Open-ILS/src/sql/Pg/002.schema.config.sql index 71e795b05..cee59a291 100644 --- a/Open-ILS/src/sql/Pg/002.schema.config.sql +++ b/Open-ILS/src/sql/Pg/002.schema.config.sql @@ -68,7 +68,7 @@ CREATE TABLE config.upgrade_log ( install_date TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW() ); -INSERT INTO config.upgrade_log (version) VALUES ('0362'); -- phasefx +INSERT INTO config.upgrade_log (version) VALUES ('0363'); -- miker 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 11eaac2fc..a8dab2cb5 100644 --- a/Open-ILS/src/sql/Pg/950.data.seed-values.sql +++ b/Open-ILS/src/sql/Pg/950.data.seed-values.sql @@ -82,6 +82,10 @@ INSERT INTO config.metabib_field ( id, field_class, name, label, format, xpath ) (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()$$ ); +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 + (27, 'identifier', 'bibid', oils_i18n_gettext(27, 'Internal ID', 'cmf', 'label'), 'marcxml', $$//marc:datafield[@tag='901']/marc:subfield[@code='c']$$ ); SELECT SETVAL('config.metabib_field_id_seq'::TEXT, (SELECT MAX(id) FROM config.metabib_field), TRUE); @@ -99,6 +103,8 @@ INSERT INTO config.metabib_search_alias (alias,field_class,field) VALUES ('eg.is INSERT INTO config.metabib_search_alias (alias,field_class,field) VALUES ('eg.issn','identifier', 19); INSERT INTO config.metabib_search_alias (alias,field_class,field) VALUES ('eg.upc','identifier', 20); INSERT INTO config.metabib_search_alias (alias,field_class,field) VALUES ('eg.callnumber','identifier', 25); +INSERT INTO config.metabib_search_alias (alias,field_class,field) VALUES ('eg.tcn','identifier', 26); +INSERT INTO config.metabib_search_alias (alias,field_class,field) VALUES ('eg.bibid','identifier', 27); INSERT INTO config.metabib_search_alias (alias,field_class) VALUES ('au','author'); INSERT INTO config.metabib_search_alias (alias,field_class) VALUES ('name','author'); diff --git a/Open-ILS/src/sql/Pg/upgrade/0363.data.index-tcn-and-bibid.sql b/Open-ILS/src/sql/Pg/upgrade/0363.data.index-tcn-and-bibid.sql new file mode 100644 index 000000000..4b7942610 --- /dev/null +++ b/Open-ILS/src/sql/Pg/upgrade/0363.data.index-tcn-and-bibid.sql @@ -0,0 +1,13 @@ +BEGIN; + +INSERT INTO config.upgrade_log (version) VALUES ('0363'); -- miker + +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 + (27, 'identifier', 'bibid', oils_i18n_gettext(27, 'Internal ID', 'cmf', 'label'), 'marcxml', $$//marc:datafield[@tag='901']/marc:subfield[@code='c']$$ ); +INSERT INTO config.metabib_search_alias (alias,field_class,field) VALUES ('eg.tcn','identifier', 26); +INSERT INTO config.metabib_search_alias (alias,field_class,field) VALUES ('eg.bibid','identifier', 27); + +COMMIT; + -- 2.11.0