
DB at M-and-D
Nov 19, 2009, 12:10 PM
Post #1 of 3
(869 views)
Permalink
|
|
Pragma max_matches question
|
|
> * 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 _______________________________________________ interchange-users mailing list interchange-users [at] icdevgroup http://www.icdevgroup.org/mailman/listinfo/interchange-users
|