diff options
author | Eric Wong <e@yhbt.net> | 2020-08-22 06:06:26 +0000 |
---|---|---|
committer | Eric Wong <e@yhbt.net> | 2020-08-23 00:14:02 +0000 |
commit | aad1b9e70529b78d3d7d62b0920ad82ca40f9592 (patch) | |
tree | 23c8ace1fbcb52bbf0cf00c0f7a83fa006ba99b5 /lib/PublicInbox/SearchQuery.pm | |
parent | ae546078c5696ac73ad9f48c2c90163febb4a246 (diff) | |
download | public-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/SearchQuery.pm')
-rw-r--r-- | lib/PublicInbox/SearchQuery.pm | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/PublicInbox/SearchQuery.pm b/lib/PublicInbox/SearchQuery.pm index ce1eae12..6724ae39 100644 --- a/lib/PublicInbox/SearchQuery.pm +++ b/lib/PublicInbox/SearchQuery.pm @@ -12,7 +12,8 @@ our $LIM = 200; sub new { my ($class, $qp) = @_; - my $r = $qp->{r}; + my $r = $qp->{r}; # relevance + my $t = $qp->{t}; # collapse threads my ($l) = (($qp->{l} || '') =~ /([0-9]+)/); $l = $LIM if !$l || $l > $LIM; bless { @@ -21,6 +22,7 @@ sub new { o => (($qp->{o} || '0') =~ /(-?[0-9]+)/), l => $l, r => (defined $r && $r ne '0'), + t => (defined $t && $t ne '0'), }, $class; } @@ -41,8 +43,8 @@ sub qs_html { if (my $l = $self->{l}) { $qs .= "&l=$l" unless $l == $LIM; } - if (my $r = $self->{r}) { - $qs .= "&r"; + for my $bool (qw(r t)) { + $qs .= "&$bool" if $self->{$bool}; } if (my $x = $self->{x}) { $qs .= "&x=$x" if ($x eq 't' || $x eq 'A' || $x eq 'm'); |