Search Patrons - Make patron search more forgiving.
authorKyle M Hall <kyle.m.hall@gmail.com>
Thu, 4 Mar 2010 16:15:47 +0000 (16:15 +0000)
committerGalen Charlton <gmcharlt@gmail.com>
Fri, 30 Apr 2010 02:45:29 +0000 (22:45 -0400)
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'.

Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
members/member.pl

index aaa3c0e..700f200 100755 (executable)
@@ -94,7 +94,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);