Remove [ and ] characters from seriestitle index LP#1187521
authorSteven Callender <stevecallender@esilibrary.com>
Tue, 4 Jun 2013 18:11:50 +0000 (14:11 -0400)
committerMike Rylander <mrylander@gmail.com>
Thu, 22 Aug 2013 15:28:27 +0000 (11:28 -0400)
Signed-off-by: Steven Callender <stevecallender@esilibrary.com>
Signed-off-by: Mike Rylander <mrylander@gmail.com>

Open-ILS/src/sql/Pg/950.data.seed-values.sql
Open-ILS/src/sql/Pg/upgrade/xxxx.data.series_normalizer.sql [new file with mode: 0644]

index e524142..9893eae 100644 (file)
@@ -7530,6 +7530,26 @@ INSERT INTO config.metabib_field_index_norm_map (field,norm,params)
       WHERE i.func IN ('replace')
             AND m.id IN (19);
 
+INSERT INTO config.metabib_field_index_norm_map (field,norm,params, pos)
+     SELECT  m.id,
+             i.id,
+             $$["]",""]$$,
+             '-1'
+       FROM  config.metabib_field m,
+             config.index_normalizer i
+       WHERE i.func IN ('replace')
+             AND m.id IN (1);
+             
+INSERT INTO config.metabib_field_index_norm_map (field,norm,params, pos)
+     SELECT  m.id,
+             i.id,
+             $$["[",""]$$,
+             '-1'
+       FROM  config.metabib_field m,
+             config.index_normalizer i
+       WHERE i.func IN ('replace')
+             AND m.id IN (1);
+
 INSERT INTO config.metabib_field_index_norm_map (field,norm,pos)
     SELECT  m.id,
             i.id,
diff --git a/Open-ILS/src/sql/Pg/upgrade/xxxx.data.series_normalizer.sql b/Open-ILS/src/sql/Pg/upgrade/xxxx.data.series_normalizer.sql
new file mode 100644 (file)
index 0000000..1249a63
--- /dev/null
@@ -0,0 +1,28 @@
+BEGIN;
+
+-- Remove [ and ] characters from seriestitle.
+-- Those characters don't play well when searching.
+
+SELECT evergreen.upgrade_deps_block_check('xxxx', :eg_version); -- Callender
+
+INSERT INTO config.metabib_field_index_norm_map (field,norm,params, pos)
+     SELECT  m.id,
+             i.id,
+             $$["]",""]$$,
+             '-1'
+       FROM  config.metabib_field m,
+             config.index_normalizer i
+       WHERE i.func IN ('replace')
+             AND m.id IN (1);
+             
+INSERT INTO config.metabib_field_index_norm_map (field,norm,params, pos)
+     SELECT  m.id,
+             i.id,
+             $$["[",""]$$,
+             '-1'
+       FROM  config.metabib_field m,
+             config.index_normalizer i
+       WHERE i.func IN ('replace')
+             AND m.id IN (1);
+
+COMMIT;