No subject


Wed Apr 9 04:39:35 UTC 2008


but basically for all possible defaults you want to have in your searches.
If you do not define them, they are not picked up and will be picking the
default from the search PMs ...

A possible (not thouroughly tested!!!!) solution is provided with the below
patch. Perhaps someone has some time to look at this to see if there is
anything that can be done differently/better.   The patch probably will
solve your problem though and I do not see it introduce other problems so
far. It is only for MV_DEFAULT_MATCHLIMIT, but can be extended.

And one more remark: When testing I noticed that when you do a search it
actually goes 3 times through certain subs (such as 'finish_search')  which
I find rather odd (add some ::logDebug line to it and you get some funky
results (below for the left search box on the demo site):

Vend::Scan:debug: searching....
Vend::Scan:debug: _matchlimit, return value: 10
Vend::Scan:debug: finish_search, $q->{mv_matchlimit} : 10
Vend::Scan:debug: finish_search, $::Values->{mv_matchlimit} : 10
Vend::Scan:debug: finish_search, $q->{mv_matchlimit} : 10
Vend::Scan:debug: finish_search, $::Values->{mv_matchlimit} : 10
Vend::Scan:debug: searching....
Vend::Scan:debug: finish_search, $q->{mv_matchlimit} : 50
Vend::Scan:debug: finish_search, $::Values->{mv_matchlimit} : 50
Vend::Scan:debug: finish_search, $q->{mv_matchlimit} : 50
Vend::Scan:debug: finish_search, $::Values->{mv_matchlimit} : 50
Vend::Scan:debug: searching....
Vend::Scan:debug: _matchlimit, return value: 1000
Vend::Scan:debug: finish_search, $q->{mv_matchlimit} : 1000
Vend::Scan:debug: finish_search, $::Values->{mv_matchlimit} : 1000
Vend::Scan:debug: finish_search, $q->{mv_matchlimit} : 1000
Vend::Scan:debug: finish_search, $::Values->{mv_matchlimit} : 1000


CU,

Gert


--- /opt/site/cvs/interchange/lib/Vend/Scan.pm  2008-07-08
17:07:34.000000000 +0200
+++ Scan.pm     2008-07-08 17:23:39.000000000 +0200
@@ -202,6 +202,11 @@
 my %RevScan;
 %RevScan = reverse %Scan;

+my %MV_Defaults = ( qw (
+        MV_DEFAULT_MATCHLIMIT mv_matchlimit
+      )
+);
+
 my %Parse = (
        mv_search_group         =>  \&_array,
        mv_search_field         =>  \&_array,
@@ -489,6 +494,15 @@
                        }
                        last if $options{$p} eq '-1' and $p eq 'mv_profile';
                }
+#::logDebug("Parsing Defaults");
+               foreach my $default (keys %MV_Defaults) {
+                       if (defined ($::Variable->{$default})) {
+                               $p = $MV_Defaults{$default};
+#::logDebug("Processing default: $default");
+                               $options{$p} = &{$Parse{$p}}(\%options,
$c->{$p});
+                       }
+               }
+
        }

 #::logDebug("Cache key: $options{mv_cache_key}");




More information about the interchange-users mailing list