[freeside-commits] branch FREESIDE_3_BRANCH updated. bb2c4fd6f87c1bf47ca3fdbf7a2874179ec2673a

Ivan ivan at 420.am
Fri Nov 15 15:58:34 PST 2013


The branch, FREESIDE_3_BRANCH has been updated
       via  bb2c4fd6f87c1bf47ca3fdbf7a2874179ec2673a (commit)
      from  060d5ba818caef48a659ed3c2e6a22b5c3d69d10 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit bb2c4fd6f87c1bf47ca3fdbf7a2874179ec2673a
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Fri Nov 15 15:58:34 2013 -0800

    fix search performance (and possibly results?), RT#25985, RT#25687

diff --git a/FS/FS/cust_main/Search.pm b/FS/FS/cust_main/Search.pm
index 215fdc2..b143861 100644
--- a/FS/FS/cust_main/Search.pm
+++ b/FS/FS/cust_main/Search.pm
@@ -358,28 +358,30 @@ sub smart_search {
 
       #substring
 
-      my @hashrefs = (
+      my @company_hashrefs = (
         { 'company'      => { op=>'ILIKE', value=>"%$value%" }, },
         { 'ship_company' => { op=>'ILIKE', value=>"%$value%" }, },
       );
 
+      my @hashrefs = ();
+
       if ( $first && $last ) {
 
-        push @hashrefs,
+        @hashrefs = (
           { 'first'        => { op=>'ILIKE', value=>"%$first%" },
             'last'         => { op=>'ILIKE', value=>"%$last%" },
           },
-        ;
+        );
 
       } else {
 
-        push @hashrefs,
+        @hashrefs = (
           { 'first'        => { op=>'ILIKE', value=>"%$value%" }, },
           { 'last'         => { op=>'ILIKE', value=>"%$value%" }, },
-        ;
+        );
       }
 
-      foreach my $hashref ( @hashrefs ) {
+      foreach my $hashref ( @company_hashrefs, @hashrefs ) {
 
         push @cust_main, qsearch( {
           'table'     => 'cust_main',
@@ -405,8 +407,6 @@ sub smart_search {
 
       #contact substring
 
-      shift @hashrefs; #no company column in contact table
-     
       foreach my $hashref ( @hashrefs ) {
 
         push @cust_main,

-----------------------------------------------------------------------

Summary of changes:
 FS/FS/cust_main/Search.pm |   16 ++++++++--------
 1 files changed, 8 insertions(+), 8 deletions(-)




More information about the freeside-commits mailing list