From 3309be7398419fd6bbd96a5591cd73de93e69729 Mon Sep 17 00:00:00 2001 From: miker Date: Wed, 2 Jul 2008 02:21:57 +0000 Subject: [PATCH] treat full birth/death dates specially, as tsearch2 is inconsistent between 8.1 and 8.2 git-svn-id: svn://svn.open-ils.org/ILS/branches/rel_1_2@9958 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/src/perlmods/OpenILS/Application/Ingest.pm | 4 ++++ Open-ILS/src/perlmods/OpenILS/Application/Storage/FTS.pm | 1 + 2 files changed, 5 insertions(+) diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Ingest.pm b/Open-ILS/src/perlmods/OpenILS/Application/Ingest.pm index 39285ca389..cbf7758766 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Ingest.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Ingest.pm @@ -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; diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Storage/FTS.pm b/Open-ILS/src/perlmods/OpenILS/Application/Storage/FTS.pm index c20edf2f6e..c6362360f2 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Storage/FTS.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Storage/FTS.pm @@ -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); -- 2.11.0