lib/PublicInbox/Mbox.pm | 2 +- lib/PublicInbox/Search.pm | 5 +++++ lib/PublicInbox/View.pm | 2 +- diff --git a/lib/PublicInbox/Mbox.pm b/lib/PublicInbox/Mbox.pm index fd623f6d48bd4e63ae3fc8d762e5a75fed39f993..2565ea58a07d327b94c8947ceb705427c17fc0fb 100644 --- a/lib/PublicInbox/Mbox.pm +++ b/lib/PublicInbox/Mbox.pm @@ -115,7 +115,7 @@ gz => IO::Compress::Gzip->new(\$buf, Time => 0), cb => $cb, ctx => $ctx, msgs => [], - opts => { asc => 1, offset => 0 }, + opts => { offset => 0 }, }, $class; } diff --git a/lib/PublicInbox/Search.pm b/lib/PublicInbox/Search.pm index 8da30c19c9d87661e4f4a0b7f8435f1d69d59c81..5e6bfc68bdb3d20985ffc177660b270c6ed3cd09 100644 --- a/lib/PublicInbox/Search.pm +++ b/lib/PublicInbox/Search.pm @@ -158,6 +158,11 @@ $qtid = Search::Xapian::Query->new(OP_OR, $qtid, $qsub); } $opts ||= {}; $opts->{limit} ||= 1000; + + # always sort threads by timestamp, this makes life easier + # for the threading algorithm (in SearchThread.pm) + $opts->{asc} = 1; + _do_enquire($self, $qtid, $opts); } diff --git a/lib/PublicInbox/View.pm b/lib/PublicInbox/View.pm index c2e1ae76a400aef4395fc77641c23fe37668e3a1..ec5f7e0f162b57359714ac90bd6590fb43728420 100644 --- a/lib/PublicInbox/View.pm +++ b/lib/PublicInbox/View.pm @@ -327,7 +327,7 @@ sub thread_html { my ($ctx) = @_; my $mid = $ctx->{mid}; - my $sres = $ctx->{srch}->get_thread($mid, { asc => 1 }); + my $sres = $ctx->{srch}->get_thread($mid); my $msgs = load_results($sres); my $nr = $sres->{total}; return missing_thread($ctx) if $nr == 0;