[open-ils-commits] r15503 - in trunk/Open-ILS: src/perlmods/OpenILS/Application src/perlmods/OpenILS/Application/Search src/perlmods/OpenILS/Application/Storage/Driver/Pg web/opac/skin/default/js (miker)

svn at svn.open-ils.org svn at svn.open-ils.org
Thu Feb 11 13:22:36 EST 2010


Author: miker
Date: 2010-02-11 13:22:32 -0500 (Thu, 11 Feb 2010)
New Revision: 15503

Modified:
   trunk/Open-ILS/src/perlmods/OpenILS/Application/Ingest.pm
   trunk/Open-ILS/src/perlmods/OpenILS/Application/Search/Biblio.pm
   trunk/Open-ILS/src/perlmods/OpenILS/Application/Storage/Driver/Pg/fts.pm
   trunk/Open-ILS/web/opac/skin/default/js/rresult.js
Log:
forward-porting r15501: Normalization for ratio-like strings -- specifically for map scale ratios; allow the default search class (as specified in the basic search dropdown) to target a specific index

Modified: trunk/Open-ILS/src/perlmods/OpenILS/Application/Ingest.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Application/Ingest.pm	2010-02-11 18:22:11 UTC (rev 15502)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Application/Ingest.pm	2010-02-11 18:22:32 UTC (rev 15503)
@@ -900,6 +900,11 @@
             $value =~ s/\pC+//sgo;
             $value =~ s/\W+$//sgo;
 
+            # hack to normalize ratio-like strings
+            while ($term =~ /\b\d{1}:[, ]?\d+(?:[ ,]\d+[^:])+/o) {
+                $term = $` . join ('', split(/[, ]/, $&)) . $';
+            }
+
             $value =~ s/\b\.+\b//sgo;
             $value = lc($value);
 

Modified: trunk/Open-ILS/src/perlmods/OpenILS/Application/Search/Biblio.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Application/Search/Biblio.pm	2010-02-11 18:22:11 UTC (rev 15502)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Application/Search/Biblio.pm	2010-02-11 18:22:32 UTC (rev 15503)
@@ -612,7 +612,7 @@
         # Add this data to the default search class
         my $type = $arghash->{default_class} || 'keyword';
         $type = ($type eq '-') ? 'keyword' : $type;
-        $type = ($type !~ /^(title|author|keyword|subject|series)$/o) ? 'keyword' : $type;
+        $type = ($type !~ /^(title|author|keyword|subject|series)(?:\|\w+)?$/o) ? 'keyword' : $type;
         $search->{$type} =  {} unless $search->{$type};
         $search->{$type}->{term} =
             ($search->{$type}->{term}) ? $search->{$type}->{term} . " $query" : $query;

Modified: trunk/Open-ILS/src/perlmods/OpenILS/Application/Storage/Driver/Pg/fts.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Application/Storage/Driver/Pg/fts.pm	2010-02-11 18:22:11 UTC (rev 15502)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Application/Storage/Driver/Pg/fts.pm	2010-02-11 18:22:32 UTC (rev 15503)
@@ -23,6 +23,12 @@
 
 		$term =~ s/(\pM+)//gos;
 		$term =~ s/(\b\.\b)//gos;
+
+		# hack to normalize ratio-like strings
+		while ($term =~ /\b\d{1}:[, ]?\d+(?:[ ,]\d+[^:])+/o) {
+			$term = $` . join ('', split(/[, ]/, $&)) . $';
+		}
+
 		$self->decompose($term);
 
 		my $newterm = '';

Modified: trunk/Open-ILS/web/opac/skin/default/js/rresult.js
===================================================================
--- trunk/Open-ILS/web/opac/skin/default/js/rresult.js	2010-02-11 18:22:11 UTC (rev 15502)
+++ trunk/Open-ILS/web/opac/skin/default/js/rresult.js	2010-02-11 18:22:32 UTC (rev 15503)
@@ -30,8 +30,12 @@
 function rresultCollectIds() {
 	var ids;
 
-	switch(getRtype()) {
+    var rtype = getRtype();
+    if (rtype.indexOf('|') > -1)
+        rtype = rtype.substring(0,rtype.indexOf('|'));
 
+	switch(rtype) {
+
 		case RTYPE_COOKIE:
 			ids = JSON2js(cookieManager.read(COOKIE_RIDS));
 			_rresultHandleIds( ids, ids.length );



More information about the open-ils-commits mailing list