[ic] Pragma max_matches question

DB DB at M-and-D.com
Thu Nov 19 20:10:05 UTC 2009


> * Make mv_max_matches stop all further searching once the limit is hit,
> 
> rather than loading the entire result set into memory and then truncating
> 
> it.
> 
> 
> 
> In my tests with a 700,000+ row products table, this is dramatically
> 
> faster when limiting results to 1000, but surprisingly it adds little
> 
> overhead even when still fetching the entire table.
> 
> 
> 
> * Add pragma max_matches, which takes precedence over user-supplied
> 
> mv_max_matches unless the user-supplied argument is more restrictive.
> 
> 
> 
> Please note that e.g. [pragma max_matches 1000] on a search landing page
> 
> will be processed too late to affect the search, because searches are
> 
> done in an ActionMap that runs before the page is seen.
> 
> 
> 
> You can use a catalog Pragma directive like this:
> 
> 
> 
> Pragma max_matches=1000
> 
> 
> 
> Which will affect everything in the catalog, including the admin.
> 
> 
> 
> If you want to make exceptions to the mv_max_matches limit based on URL,
> 
> you can instead use an Autoload that calls a GlobalSub, like this:
> 
> 
> 
> interchange.cfg:
> 
> 
> 
> GlobalSub <<EOR
> 
> sub set_pragma_max_matches {
> 
>     $::Pragma->{max_matches} = 1000
> 
>         unless $Vend::FinalPath =~ m{^/admin/};
> 
>     return;
> 
> }
> 
> EOR
> 
> 
> 
> catalog.cfg:
> 

> 
> Autoload set_pragma_max_matches

I've been using Jon's awesome patch for a few days and it works great. I
have a need to use the Autoload to prevent limits on the number of
matches returned for searches run from pages in the directory
..../pages/orderinfo/, a custom directory I created. I've not been able
to get this to work using:

GlobalSub <<EOR
 sub set_pragma_max_matches {
     $::Pragma->{max_matches} = 1000
          unless $Vend::FinalPath =~ m{^/orderinfo/};
     return;
 }
EOR

I could also live with suppressing the match limit for only users logged
in under a few specific usernames - if I knew how to code that. Can
anyone help?

Thanks!

DB







More information about the interchange-users mailing list