treat full birth/death dates specially, as tsearch2 is inconsistent between 8.1 and 8.2
authormiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 2 Jul 2008 02:22:07 +0000 (02:22 +0000)
committermiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 2 Jul 2008 02:22:07 +0000 (02:22 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/branches/rel_1_2_2@9959 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/perlmods/OpenILS/Application/Ingest.pm
Open-ILS/src/perlmods/OpenILS/Application/Storage/FTS.pm

index 39285ca..cbf7758 100644 (file)
@@ -695,6 +695,9 @@ sub xpath_to_string {
                        $string .= $value->textContent . " ";
                }
        }
+
+    $string =~ s/(\d{4})-(\d{4})/$1 $2/sgo;
+
        return NFD($string);
 }
 
@@ -900,6 +903,7 @@ sub _marcxml_to_full_rows {
                        $val =~ s/\pM+//sgo;
                        $val =~ s/\pC+//sgo;
                        $val =~ s/\W+$//sgo;
+                       $val =~ s/(\d{4})-(\d{4})/$1 $2/sgo;
                        $ns->value( lc($val) );
 
                        push @ns_list, $ns;
index c20edf2..c636236 100644 (file)
@@ -40,6 +40,7 @@ sub decompose {
        $term =~ s/(^|\s+)-(\w+)/$1!$2/go;
        $term =~ s/\b(\+)(\w+)/$2/go;
        $term =~ s/^\s*\b(.+)\b\s*$/$1/o;
+       $term =~ s/(\d{4})-(\d{4})/$1 $2/go;
        #$term =~ s/^(?:an?|the)\b(.*)/$1/o;
 
        $log->debug("Stripped search term string is [$term]",DEBUG);