]> git.ipfire.org Git - thirdparty/public-inbox.git/commitdiff
xap_helper: Perl dump_ibx respects `-m MAX'
authorEric Wong <e@80x24.org>
Mon, 13 Nov 2023 13:15:45 +0000 (13:15 +0000)
committerEric Wong <e@80x24.org>
Mon, 13 Nov 2023 21:55:05 +0000 (21:55 +0000)
The C++ version does, so the Perl/XS version should, too;
even if we intentionally avoid using it right now.

lib/PublicInbox/XapHelper.pm

index 1ee918e3f7f5bafcb8e5609c30d861293b0dd6fc..4157600f6035b9125afc087989c85848095b8d1c 100644 (file)
@@ -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);