sub sres_top_html {
my ($ctx) = @_;
my $q = PublicInbox::SearchQuery->new($ctx->{qp});
- my $code = 200;
+ my $x = $q->{x};
+ my $query = $q->{'q'};
+ return PublicInbox::Mbox::mbox_all($ctx, $query) if $x eq 'm';
+ my $code = 200;
# double the limit for expanded views:
my $opts = {
limit => $LIM,
my ($mset, $total, $err, $cb);
retry:
eval {
- $mset = $ctx->{srch}->query($q->{'q'}, $opts);
+ $mset = $ctx->{srch}->query($query, $opts);
$total = $mset->get_matches_estimated;
};
$err = $@;
$ctx->{-html_tip} = "<pre>\n[No results found]</pre><hr>";
$cb = *noop;
} else {
- my $x = $q->{x};
return adump($_[0], $mset, $q, $ctx) if $x eq 'A';
$ctx->{-html_tip} = search_nav_top($mset, $q, $ctx) . "\n\n";
}
}
-# display non-threaded search results similar to what users expect from
+# display non-nested search results similar to what users expect from
# regular WWW search engines:
sub mset_summary {
my ($ctx, $mset, $q) = @_;
my $x = $q->{x};
if ($x eq '') {
my $t = $q->qs_html(x => 't');
- $rv .= qq{<b>summary</b>|<a\nhref="?$t">threaded</a>}
+ $rv .= qq{<b>summary</b>|<a\nhref="?$t">nested</a>}
} elsif ($q->{x} eq 't') {
my $s = $q->qs_html(x => '');
- $rv .= qq{<a\nhref="?$s">summary</a>|<b>threaded</b>};
+ $rv .= qq{<a\nhref="?$s">summary</a>|<b>nested</b>};
}
my $A = $q->qs_html(x => 'A', r => undef);
$rv .= qq{|<a\nhref="?$A">Atom feed</a>]};
+ my $m = $q->qs_html(x => 'm', r => undef);
+ warn "m: $m\n";
+ $rv .= qq{\n\t\t\t\t\t\tdownload: };
+ $rv .= qq{<a\nhref="?$m"\nrel="nofollow">mbox.gz</a>};
}
sub search_nav_bot {
$qs .= "&r";
}
if (my $x = $self->{x}) {
- $qs .= "&x=$x" if ($x eq 't' || $x eq 'A');
+ $qs .= "&x=$x" if ($x eq 't' || $x eq 'A' || $x eq 'm');
}
$qs;
}