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 01:42:00 +0000 (01:42 +0000)
committermiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 2 Jul 2008 01:42:00 +0000 (01:42 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@9954 dcc99617-32d9-48b4-a31d-7c20da2025e4

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

index 39285ca..61694be 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 6dd03c0..f881a22 100644 (file)
@@ -106,6 +106,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);