[open-ils-commits] r9959 - in branches/rel_1_2_2/Open-ILS/src/perlmods/OpenILS/Application: . Storage

svn at svn.open-ils.org svn at svn.open-ils.org
Tue Jul 1 22:22:09 EDT 2008


Author: miker
Date: 2008-07-01 22:22:07 -0400 (Tue, 01 Jul 2008)
New Revision: 9959

Modified:
   branches/rel_1_2_2/Open-ILS/src/perlmods/OpenILS/Application/Ingest.pm
   branches/rel_1_2_2/Open-ILS/src/perlmods/OpenILS/Application/Storage/FTS.pm
Log:
treat full birth/death dates specially, as tsearch2 is inconsistent between 8.1 and 8.2

Modified: branches/rel_1_2_2/Open-ILS/src/perlmods/OpenILS/Application/Ingest.pm
===================================================================
--- branches/rel_1_2_2/Open-ILS/src/perlmods/OpenILS/Application/Ingest.pm	2008-07-02 02:21:57 UTC (rev 9958)
+++ branches/rel_1_2_2/Open-ILS/src/perlmods/OpenILS/Application/Ingest.pm	2008-07-02 02:22:07 UTC (rev 9959)
@@ -695,6 +695,9 @@
 			$string .= $value->textContent . " ";
 		}
 	}
+
+    $string =~ s/(\d{4})-(\d{4})/$1 $2/sgo;
+
 	return NFD($string);
 }
 
@@ -900,6 +903,7 @@
 			$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;

Modified: branches/rel_1_2_2/Open-ILS/src/perlmods/OpenILS/Application/Storage/FTS.pm
===================================================================
--- branches/rel_1_2_2/Open-ILS/src/perlmods/OpenILS/Application/Storage/FTS.pm	2008-07-02 02:21:57 UTC (rev 9958)
+++ branches/rel_1_2_2/Open-ILS/src/perlmods/OpenILS/Application/Storage/FTS.pm	2008-07-02 02:22:07 UTC (rev 9959)
@@ -40,6 +40,7 @@
 	$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);



More information about the open-ils-commits mailing list