From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.2 required=3.0 tests=ALL_TRUSTED,AWL,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, T_SCC_BODY_TEXT_LINE shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 289971F725 for ; Mon, 13 Nov 2023 13:15:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=80x24.org; s=selector1; t=1699881355; bh=0Ax9WUTxsJlimUMmZGCM48UYlPHRgxh0f7rAS94SLr8=; h=From:To:Subject:Date:In-Reply-To:References:From; b=z3eKsw6Lr2jWkJNkHZq0AfU2BOXojPU75/2DatVPcpzrEzVcwABGBb6wt7ML3viQp Bg0St2mpJCWqNaGJVM0VuI9xh4nydPBcLXj0hb4Wqp1pJ2h5IxHnJmq0X3o92loF+s i0ejNJBkkbjCNZuoKMJO8cZmZsMPYcs6mFsQKjU4= From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 12/18] xap_helper: Perl dump_ibx respects `-m MAX' Date: Mon, 13 Nov 2023 13:15:45 +0000 Message-Id: <20231113131551.843230-13-e@80x24.org> In-Reply-To: <20231113131551.843230-1-e@80x24.org> References: <20231113131551.843230-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: The C++ version does, so the Perl/XS version should, too; even if we intentionally avoid using it right now. --- lib/PublicInbox/XapHelper.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/PublicInbox/XapHelper.pm b/lib/PublicInbox/XapHelper.pm index 1ee918e3..4157600f 100644 --- a/lib/PublicInbox/XapHelper.pm +++ b/lib/PublicInbox/XapHelper.pm @@ -78,7 +78,7 @@ sub cmd_dump_ibx { my ($req, $ibx_id, $qry_str) = @_; $qry_str // return warn('usage: dump_ibx [OPTIONS] IBX_ID QRY_STR'); $req->{A} or return warn('dump_ibx requires -A PREFIX'); - my $max = $req->{srch}->{xdb}->get_doccount; + my $max = $req->{'m'} // $req->{srch}->{xdb}->get_doccount; my $opt = { relevance => -1, limit => $max, offset => $req->{o} // 0 }; $opt->{eidx_key} = $req->{O} if defined $req->{O}; my $mset = $req->{srch}->mset($qry_str, $opt);