From: Eric Wong Date: Mon, 13 Nov 2023 13:15:45 +0000 (+0000) Subject: xap_helper: Perl dump_ibx respects `-m MAX' X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=94910cdb43ae400cfc541446aa9b6164f4dce631;p=thirdparty%2Fpublic-inbox.git xap_helper: Perl dump_ibx respects `-m MAX' The C++ version does, so the Perl/XS version should, too; even if we intentionally avoid using it right now. --- diff --git a/lib/PublicInbox/XapHelper.pm b/lib/PublicInbox/XapHelper.pm index 1ee918e3f..4157600f6 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);