[OPEN-ILS-DEV] Patron Search - minor enhancement.
Niles Ingalls
nilesi at zionsville.lib.in.us
Wed May 4 12:44:51 EDT 2011
I'd like to submit this patch, which will improve patron phone search results (at least for my purposes).
This patch will do a match against digits only, when the search method is given a search string that only contains digits.
Results will be improved in cases situations where number validation is loose, or where you have some legacy records that weren't fully washed.
/openils/lib/perl5/OpenILS/Application/Storage/Publisher/actor.pm
666c666,670
< push @ps, "evergreen.lowercase($p) ~ ?";
---
> if ($pv =~ /^\d+$/) {
> push @ps, "evergreen.lowercase(REGEXP_REPLACE($p, '[^0-9]', '', 'g')) ~ ?";
> } else {
> push @ps, "evergreen.lowercase($p) ~ ?";
> }
Niles Ingalls
UNIX & Web Administrator
Hussey-Mayfield Memorial Public Library
250 N. Fifth Street
P.O. Box 840
Zionsville, IN. 46077
Phone 317-873-3149 x13280
Fax 317-873-8339
"Confidence is what you have before you understand the problem." - Woody Allen
More information about the Open-ils-dev
mailing list