[Koha-patches] [PATCH] Search Patrons - Make patron search more forgiving.

Kyle M Hall kyle.m.hall at gmail.com
Thu Mar 4 17:15:47 CET 2010


Patron search has only been searching fields for names
that either match or begin with the given search terms.

This is too strict a search.
For example, take the name "Billie Jo Robinson", "Billie Jo"
being the firstname, and "Robinson" being the last name. If one
were to search for "Billie Jo", this patron would not appear in
the search results.

 To remedy this, the search
type has been changed from 'begins_with' to 'contain'.
---
 members/member.pl |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/members/member.pl b/members/member.pl
index bc1980c..deeabbd 100755
--- a/members/member.pl
+++ b/members/member.pl
@@ -93,7 +93,7 @@ push @searchpatron, $patron if (keys %$patron);
 my $from= ($startfrom-1)*$resultsperpage;
 my $to=$from+$resultsperpage;
  #($results)=Search(\@searchpatron,{surname=>1,firstname=>1},[$from,$to],undef,["firstname","surname","email","othernames"]  ) if (@searchpatron);
- my $search_scope=($quicksearch?"field_start_with":"start_with");
+ my $search_scope=($quicksearch?"field_start_with":"contain");
  ($results)=Search(\@searchpatron,\@orderby,undef,undef,["firstname","surname","email","othernames","cardnumber","userid"],$search_scope  ) if (@searchpatron);
 if ($results){
 	$count =scalar(@$results);
-- 
1.5.6.5




More information about the Koha-patches mailing list