user/dev discussion of public-inbox itself
 help / color / mirror / code / Atom feed
From: Jonathan Corbet <corbet@lwn.net>
To: Eric Wong <e@80x24.org>
Cc: meta@public-inbox.org
Subject: Re: [PATCH] Allow specification of the number of search results to return
Date: Wed, 28 Mar 2018 15:00:31 -0600	[thread overview]
Message-ID: <20180328150031.40df6080@lwn.net> (raw)
In-Reply-To: <20180327104457.GA15422@80x24.org>

On Tue, 27 Mar 2018 10:44:57 +0000
Eric Wong <e@80x24.org> wrote:

> Jonathan Corbet <corbet@lwn.net> wrote:
> > Add an "l=" parameter to the search query syntax to specify how many
> > results should be returned.  The default remains 200.
> > ---
> > 200 is a lot of results for one page, so allow it to be tweaked.  I've not
> > added anything to the query form to access this (don't need it) but could.  
> 
> There's the "feedmax" config variable, perhaps a config option
> along those lines can be used with search results.

That would solve my problem nicely, but takes the control out of the hands
of the reader.  Is this the approach you would rather see?

> > --- a/lib/PublicInbox/SearchView.pm
> > +++ b/lib/PublicInbox/SearchView.pm
> > @@ -35,7 +35,7 @@ sub sres_top_html {
> >  	my $code = 200;
> >  	# double the limit for expanded views:
> >  	my $opts = {
> > -		limit => $LIM,
> > +		limit => $q->{l},  
> 
> Blindly trusting user input here could cause memory problems on
> the server and should be clamped to a reasonable value.

Yeah...I saw it sort of like the threat from doing a lot of simultaneous
searches.  It's better to limit it, though; I can certainly do that if you
don't prefer the config-option approach.

Thanks,

jon

  reply	other threads:[~2018-03-28 21:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-26 22:34 [PATCH] Allow specification of the number of search results to return Jonathan Corbet
2018-03-27 10:44 ` Eric Wong
2018-03-28 21:00   ` Jonathan Corbet [this message]
2018-03-28 21:40     ` Eric Wong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://public-inbox.org/README

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180328150031.40df6080@lwn.net \
    --to=corbet@lwn.net \
    --cc=e@80x24.org \
    --cc=meta@public-inbox.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/public-inbox.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).