about summary refs log tree commit homepage
path: root/lib/PublicInbox/Search.pm
diff options
context:
space:
mode:
authorEric Wong (Contractor, The Linux Foundation) <e@80x24.org>2018-04-05 09:34:09 +0000
committerEric Wong (Contractor, The Linux Foundation) <e@80x24.org>2018-04-05 10:27:13 +0000
commite194adb858f2fdb220aa43f3ce398ff9e77cc1d3 (patch)
treefa0bd1e9c1552e3e166573f9b998d5d520980d1f /lib/PublicInbox/Search.pm
parenta699c1ea84e9bb2ebd76a1bf1094b686bc520bda (diff)
downloadpublic-inbox-e194adb858f2fdb220aa43f3ce398ff9e77cc1d3.tar.gz
Sorting large msets is a waste when it comes to mboxes
since MUAs should thread and sort them as the user desires.

This forces us to rework each of the mbox download mechanisms
to be more independent of each other, but might make things
easier to reason about.
Diffstat (limited to 'lib/PublicInbox/Search.pm')
-rw-r--r--lib/PublicInbox/Search.pm6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/PublicInbox/Search.pm b/lib/PublicInbox/Search.pm
index 4e014f4e..9eb07284 100644
--- a/lib/PublicInbox/Search.pm
+++ b/lib/PublicInbox/Search.pm
@@ -219,7 +219,11 @@ sub _enquire_once {
         $enquire->set_query($query);
         $opts ||= {};
         my $desc = !$opts->{asc};
-        if ($opts->{relevance}) {
+        if (($opts->{mset} || 0) == 2) {
+                $enquire->set_docid_order(Search::Xapian::ENQ_ASCENDING());
+                $enquire->set_weighting_scheme(Search::Xapian::BoolWeight->new);
+                delete $self->{enquire};
+        } elsif ($opts->{relevance}) {
                 $enquire->set_sort_by_relevance_then_value(TS, $desc);
         } else {
                 $enquire->set_sort_by_value_then_relevance(TS, $desc);