# License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
#
# Displays search results for the web interface
# License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
#
# Displays search results for the web interface
} else {
return adump($_[0], $mset, $q, $ctx) if $x eq 'A';
} else {
return adump($_[0], $mset, $q, $ctx) if $x eq 'A';
-# allow undef for individual doc loads...
-sub load_doc_retry {
- my ($srch, $mitem) = @_;
-
- eval {
- $srch->retry_reopen(sub {
- PublicInbox::SearchMsg->load_doc($mitem->get_document)
- });
- }
-}
-
foreach my $m ($mset->items) {
my $rank = sprintf("%${pad}d", $m->get_rank + 1);
my $pct = get_pct($m);
foreach my $m ($mset->items) {
my $rank = sprintf("%${pad}d", $m->get_rank + 1);
my $pct = get_pct($m);
if ($obfs_ibx) {
obfuscate_addrs($obfs_ibx, $s);
obfuscate_addrs($obfs_ibx, $f);
}
if ($obfs_ibx) {
obfuscate_addrs($obfs_ibx, $s);
obfuscate_addrs($obfs_ibx, $f);
}
$s = '(no subject)' if $s eq '';
$$res .= qq{$rank. <b><a\nhref="$mid/">}.
$s . "</a></b>\n";
$$res .= "$pfx - by $f @ $date UTC [$pct%]\n\n";
}
$$res .= search_nav_bot($mset, $q);
$s = '(no subject)' if $s eq '';
$$res .= qq{$rank. <b><a\nhref="$mid/">}.
$s . "</a></b>\n";
$$res .= "$pfx - by $f @ $date UTC [$pct%]\n\n";
}
$$res .= search_nav_bot($mset, $q);
- my %pct;
- my $msgs = $ctx->{-inbox}->search->retry_reopen(sub { [ map {
- my $i = $_;
- my $smsg = PublicInbox::SearchMsg->load_doc($i->get_document);
- $pct{$smsg->mid} = get_pct($i);
- $smsg;
- } ($mset->items) ]});
+ my $ibx = $ctx->{-inbox};
+ my $msgs = $ibx->search->retry_reopen(\&load_msgs, $mset);
- if (keys %over) {
- my $tmp = bless { %$self }, ref($self);
- foreach my $k (keys %over) {
- $tmp->{$k} = $over{$k};
- }
- $self = $tmp;
+ if (scalar(keys(%override))) {
+ $self = bless { (%$self, %override) }, ref($self);