From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.0 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id CE4131F42D; Tue, 27 Mar 2018 10:44:57 +0000 (UTC) Date: Tue, 27 Mar 2018 10:44:57 +0000 From: Eric Wong To: Jonathan Corbet Cc: meta@public-inbox.org Subject: Re: [PATCH] Allow specification of the number of search results to return Message-ID: <20180327104457.GA15422@80x24.org> References: <20180326163431.03fe26bc@lwn.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20180326163431.03fe26bc@lwn.net> List-Id: Jonathan Corbet 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. > --- 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. Though I should note we support downloading entire mboxes of search results. However those are streamed via repeated queries and public-inbox-httpd can handle those without loading lots of data up front.