From aad1b9e70529b78d3d7d62b0920ad82ca40f9592 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sat, 22 Aug 2020 06:06:26 +0000 Subject: search: support downloading mboxes results with full thread 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. --- lib/PublicInbox/Search.pm | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib/PublicInbox/Search.pm') 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); -- cgit v1.2.3-24-ge0c7