about summary refs log tree commit homepage
path: root/lib/PublicInbox/Search.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2016-12-10 01:09:51 +0000
committerEric Wong <e@80x24.org>2016-12-10 03:29:07 +0000
commit71d0581a309ca83cf3be538141435111db8ed290 (patch)
treeb3e55cbf3ff6d2d8bf91844261fc4ea31ef189f5 /lib/PublicInbox/Search.pm
parentc6a8fdf71e2c336f6e591c6f4005c8e922c8f2df (diff)
downloadpublic-inbox-71d0581a309ca83cf3be538141435111db8ed290.tar.gz
This makes life easier for the threading algorithm, as we can
use the implied ordering of timestamps to avoid temporary ghosts
and resulting container vivication.

This would've also allowed us to hide the bug (in most cases)
fixed by the patch titled "thread: last Reference always wins",
in case that needs to be reverted due to infinite looping.
Diffstat (limited to 'lib/PublicInbox/Search.pm')
-rw-r--r--lib/PublicInbox/Search.pm5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/PublicInbox/Search.pm b/lib/PublicInbox/Search.pm
index 8da30c19..5e6bfc68 100644
--- a/lib/PublicInbox/Search.pm
+++ b/lib/PublicInbox/Search.pm
@@ -158,6 +158,11 @@ sub get_thread {
         }
         $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);
 }