about summary refs log tree commit homepage
path: root/lib/PublicInbox/Search.pm
diff options
context:
space:
mode:
authorEric Wong <e@yhbt.net>2020-08-22 06:06:26 +0000
committerEric Wong <e@yhbt.net>2020-08-23 00:14:02 +0000
commitaad1b9e70529b78d3d7d62b0920ad82ca40f9592 (patch)
tree23c8ace1fbcb52bbf0cf00c0f7a83fa006ba99b5 /lib/PublicInbox/Search.pm
parentae546078c5696ac73ad9f48c2c90163febb4a246 (diff)
downloadpublic-inbox-aad1b9e70529b78d3d7d62b0920ad82ca40f9592.tar.gz
Finally, the addition of THREADID for collapsing results
in Xapian lets us emulate the "mairix --threads" feature.
That is, instead of returning only the matching messages,
the entire thread is included in the downloaded mbox.gz

This requires a "public-inbox-index --reindex" to be usable.
Diffstat (limited to 'lib/PublicInbox/Search.pm')
-rw-r--r--lib/PublicInbox/Search.pm4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/PublicInbox/Search.pm b/lib/PublicInbox/Search.pm
index 4cfb7b38..bc820b64 100644
--- a/lib/PublicInbox/Search.pm
+++ b/lib/PublicInbox/Search.pm
@@ -326,6 +326,10 @@ sub _enquire_once { # retry_reopen callback
         } else {
                 $enquire->set_sort_by_value_then_relevance(TS, $desc);
         }
+
+        # `mairix -t / --threads' or JMAP collapseThreads
+        $enquire->set_collapse_key(THREADID) if $opts->{thread};
+
         my $offset = $opts->{offset} || 0;
         my $limit = $opts->{limit} || 50;
         my $mset = $enquire->get_mset($offset, $limit);