Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Interchange: users

Pragma max_matches question

 

 

Interchange users RSS feed   Index | Next | Previous | View Threaded


DB at M-and-D

Nov 19, 2009, 12:10 PM

Post #1 of 3 (870 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


jon at endpoint

Nov 19, 2009, 6:26 PM

Post #2 of 3 (812 views)
Permalink
Re: Pragma max_matches question [In reply to]

On Thu, 19 Nov 2009, DB wrote:

> 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?

You should be able to check against $Vend::Session->{username} for that.

Jon

--
Jon Jensen
End Point Corporation
http://www.endpoint.com/

_______________________________________________
interchange-users mailing list
interchange-users [at] icdevgroup
http://www.icdevgroup.org/mailman/listinfo/interchange-users


lists at gmnet

Nov 21, 2009, 1:10 PM

Post #3 of 3 (796 views)
Permalink
Re: Pragma max_matches question [In reply to]

On Thu, 2009-11-19 at 19:26 -0700, Jon Jensen wrote:
> On Thu, 19 Nov 2009, DB wrote:
>
> > 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?
>
> You should be able to check against $Vend::Session->{username} for that.
>
> Jon
>
> --
> Jon Jensen
> End Point Corporation
> http://www.endpoint.com/
>

You might also want to think about setting a variable for all particular
users such as the "dealer" flag. Make a new field in the userdb for
this where you can flag users. then instead of [if scratch dealer] you
can use [if scratch suppress... or whatever] this way you can group
users together for this and turn them on or off in the database.

rick



--
This message has been scanned for viruses and
dangerous content by Green Mountain Network, and is
believed to be clean.


_______________________________________________
interchange-users mailing list
interchange-users [at] icdevgroup
http://www.icdevgroup.org/mailman/listinfo/interchange-users

Interchange users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.