From 4ff570e5c3cfb33aff3ca6ad674958d9dd2abda9 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sun, 10 Jan 2021 12:14:58 +0000 Subject: lei query + pagination sorta working Parallelism and interactivity with pager + SIGPIPE needs work; but results are shown and phrase search works without shell users having to apply Xapian quoting rules on top of standard shell quoting. --- lib/PublicInbox/Search.pm | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'lib/PublicInbox/Search.pm') diff --git a/lib/PublicInbox/Search.pm b/lib/PublicInbox/Search.pm index 0bdf6fc6..7f68ee01 100644 --- a/lib/PublicInbox/Search.pm +++ b/lib/PublicInbox/Search.pm @@ -6,7 +6,7 @@ package PublicInbox::Search; use strict; use parent qw(Exporter); -our @EXPORT_OK = qw(retry_reopen int_val); +our @EXPORT_OK = qw(retry_reopen int_val get_pct); use List::Util qw(max); # values for searching, changing the numeric value breaks @@ -424,4 +424,12 @@ sub int_val ($$) { sortable_unserialise($val) + 0; # PV => IV conversion } +sub get_pct ($) { # mset item + # Capped at "99%" since "100%" takes an extra column in the + # thread skeleton view. says the value isn't + # very meaningful, anyways. + my $n = $_[0]->get_percent; + $n > 99 ? 99 : $n; +} + 1; -- cgit v1.2.3-24-ge0c7