fixing regex and fts searching
authormiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 1 Jul 2005 15:57:26 +0000 (15:57 +0000)
committermiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 1 Jul 2005 15:57:26 +0000 (15:57 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@1022 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/perlmods/OpenILS/Application/Storage/CDBI.pm
Open-ILS/src/sql/Postgres/002.schema.config.sql

index 5345c2f..07fbe71 100644 (file)
@@ -121,7 +121,7 @@ sub fast_fieldmapper {
                        $search_type = 'search_regex'
                }
 
-               for my $obj ($cdbi->$search_type({ $col => $id})) {
+               for my $obj ($class->$search_type({ $col => $id})) {
                        push @fms, $obj->to_fieldmapper;
                }
        }
index ad99586..d528a99 100644 (file)
@@ -116,4 +116,50 @@ INSERT INTO config.net_access_level (name) VALUES ('Restricted');
 INSERT INTO config.net_access_level (name) VALUES ('Full');
 INSERT INTO config.net_access_level (name) VALUES ('None');
 
+
+
+/*
+
+CREATE TABLE config.new_metabib_field (
+       id              SERIAL  PRIMARY KEY,
+       field_class     TEXT    NOT NULL CHECK (lower(field_class) IN ('title','author','subject','keyword','series')),
+       name            TEXT    NOT NULL UNIQUE,
+       search_xpath    TEXT    NOT NULL,
+       browse_xpath    TEXT
+);
+
+INSERT INTO config.new_metabib_field ( field_class, name, search_xpath, browse_xpath )
+       VALUES ( 'series', 'seriestitle', $$//mods/relatedItem[@type="series"]/titleInfo$$, $$//mods/relatedItem[@type="series"]/titleInfo/title$$ );
+
+INSERT INTO config.new_metabib_field ( field_class, name, search_xpath, browse_xpath )
+       VALUES ( 'title', 'abbreviated', $$//mods/titleInfo[title and (@type='abreviated')]$$, $$//mods/titleInfo[title and (@type='abreviated')]/title$$ );
+INSERT INTO config.new_metabib_field ( field_class, name, search_xpath, browse_xpath )
+       VALUES ( 'title', 'translated', $$//mods/titleInfo[title and (@type='translated')]$$, $$//mods/titleInfo[title and (@type='translated')]/title$$ );
+INSERT INTO config.new_metabib_field ( field_class, name, search_xpath, browse_xpath )
+       VALUES ( 'title', 'uniform', $$//mods/titleInfo[title and (@type='uniform')]$$, $$//mods/titleInfo[title and (@type='uniform')]/title$$ );
+INSERT INTO config.new_metabib_field ( field_class, name, search_xpath, browse_xpath )
+       VALUES ( 'title', 'proper', $$//mods/titleInfo[title and not (@type)]$$, $$//mods/titleInfo[title and not (@type)]/title$$ );
+
+INSERT INTO config.new_metabib_field ( field_class, name, search_xpath )
+       VALUES ( 'author', 'corporate', $$//mods/name[@type='corporate']/namePart[../role/text[text()='creator']]$$ );
+INSERT INTO config.new_metabib_field ( field_class, name, search_xpath )
+       VALUES ( 'author', 'personal', $$//mods/name[@type='personal']/namePart[../role/text[text()='creator']]$$ );
+INSERT INTO config.new_metabib_field ( field_class, name, search_xpath )
+       VALUES ( 'author', 'conference', $$//mods/name[@type='conference']/namePart[../role/text[text()='creator']]$$ );
+INSERT INTO config.new_metabib_field ( field_class, name, search_xpath )
+       VALUES ( 'author', 'other', $$//mods/name[@type='personal']/namePart[not(../role)]$$ );
+
+INSERT INTO config.new_metabib_field ( field_class, name, search_xpath )
+       VALUES ( 'subject', 'geographic', $$//mods/subject/geographic$$ );
+INSERT INTO config.new_metabib_field ( field_class, name, search_xpath )
+       VALUES ( 'subject', 'name', $$//mods/subject/name$$ );
+INSERT INTO config.new_metabib_field ( field_class, name, search_xpath )
+       VALUES ( 'subject', 'temporal', $$//mods/subject/temporal$$ );
+INSERT INTO config.new_metabib_field ( field_class, name, search_xpath )
+       VALUES ( 'subject', 'topic', $$//mods/subject/topic$$ );
+INSERT INTO config.new_metabib_field ( field_class, name, search_xpath )
+       VALUES ( 'keyword', 'keyword', $$//mods/*[not(local-name()='originInfo')]$$ ); 
+
+*/
+
 COMMIT;