forward-porting r15501: Normalization for ratio-like strings -- specifically for...
authormiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 11 Feb 2010 18:22:32 +0000 (18:22 +0000)
committermiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 11 Feb 2010 18:22:32 +0000 (18:22 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@15503 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/perlmods/OpenILS/Application/Ingest.pm
Open-ILS/src/perlmods/OpenILS/Application/Search/Biblio.pm
Open-ILS/src/perlmods/OpenILS/Application/Storage/Driver/Pg/fts.pm
Open-ILS/web/opac/skin/default/js/rresult.js

index f794479..30892b5 100644 (file)
@@ -900,6 +900,11 @@ sub class_index_string_xml {
             $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);
 
index 0ef938b..49bccda 100644 (file)
@@ -612,7 +612,7 @@ sub multiclass_query {
         # 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;
index c7c307a..055266a 100644 (file)
 
                $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 = '';
index d93aa45..4a7fb35 100644 (file)
@@ -30,7 +30,11 @@ function rresultDoSearch() {
 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));