]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/SearchView.pm
searchview: increase limit for displaying search results
[public-inbox.git] / lib / PublicInbox / SearchView.pm
index bd634d8dbd29ead4f86c757dd421e8cf9c6fccf4..f1c4b6a052181e28c28127403a07d3732972151b 100644 (file)
@@ -10,10 +10,10 @@ use PublicInbox::Hval qw/ascii_html/;
 use PublicInbox::View;
 use PublicInbox::WwwAtomStream;
 use PublicInbox::MID qw(mid2path mid_mime mid_clean mid_escape);
-use Email::MIME;
+use PublicInbox::MIME;
 require PublicInbox::Git;
 require PublicInbox::SearchThread;
-our $LIM = 50;
+our $LIM = 200;
 
 sub noop {}
 
@@ -145,15 +145,21 @@ sub search_nav_bot {
        my $o = $q->{o};
        my $end = $o + $nr;
        my $beg = $o + 1;
-       my $rv = "</pre><hr><pre>Results $beg-$end of $total";
+       my $rv = '</pre><hr><pre>';
+       if ($beg <= $end) {
+               $rv .= "Results $beg-$end of $total";
+               $rv .= ' (estimated)' if $end != $total;
+       } else {
+               $rv .= "No more results, only $total";
+       }
        my $n = $o + $LIM;
 
        if ($n < $total) {
                my $qs = $q->qs_html(o => $n);
-               $rv .= qq{, <a\nhref="?$qs"\nrel=next>next</a>}
+               $rv .= qq{  <a\nhref="?$qs"\nrel=next>next</a>}
        }
        if ($o > 0) {
-               $rv .= $n < $total ? '/' : ',      ';
+               $rv .= $n < $total ? '/' : '       ';
                my $p = $o - $LIM;
                my $qs = $q->qs_html(o => ($p > 0 ? $p : 0));
                $rv .= qq{<a\nhref="?$qs"\nrel=prev>prev</a>};
@@ -205,7 +211,7 @@ sub mset_thread {
                        $mime = $inbox->msg_by_smsg($mime) and last;
                }
                if ($mime) {
-                       $mime = Email::MIME->new($mime);
+                       $mime = PublicInbox::MIME->new($mime);
                        return PublicInbox::View::index_entry($mime, $ctx,
                                scalar @$msgs);
                }
@@ -239,7 +245,7 @@ sub adump {
                while (my $x = shift @items) {
                        $x = load_doc_retry($srch, $x);
                        $x = $ibx->msg_by_smsg($x) and
-                                       return Email::MIME->new($x);
+                                       return PublicInbox::MIME->new($x);
                }
                return undef;
        });