about summary refs log tree commit homepage
path: root/lib/PublicInbox/SearchView.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2017-10-03 19:43:30 +0000
committerEric Wong <e@80x24.org>2017-10-03 20:00:41 +0000
commit38c481a5438593cff686709493a70b8a6b3033d1 (patch)
treec288246c52611759bfddcbb4bb371a3bd1bb789e /lib/PublicInbox/SearchView.pm
parent2aa29ee6a35f5be2d76c39ccc50bf7a34075e2bd (diff)
downloadpublic-inbox-38c481a5438593cff686709493a70b8a6b3033d1.tar.gz
Since we attempt to fill in threads by Subject, our thread
skeletons can cross actual thread IDs, leading to the
possibility of false ghosts showing up in the skeleton.
Try to fill in the ghosts as well as possible by performing
a message lookup.
Diffstat (limited to 'lib/PublicInbox/SearchView.pm')
-rw-r--r--lib/PublicInbox/SearchView.pm6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/PublicInbox/SearchView.pm b/lib/PublicInbox/SearchView.pm
index a5974034..c42cf2d6 100644
--- a/lib/PublicInbox/SearchView.pm
+++ b/lib/PublicInbox/SearchView.pm
@@ -207,7 +207,8 @@ sub sort_relevance {
 sub mset_thread {
         my ($ctx, $mset, $q) = @_;
         my %pct;
-        my $msgs = $ctx->{srch}->retry_reopen(sub { [ map {
+        my $srch = $ctx->{srch};
+        my $msgs = $srch->retry_reopen(sub { [ map {
                 my $i = $_;
                 my $smsg = PublicInbox::SearchMsg->load_doc($i->get_document);
                 $pct{$smsg->mid} = $i->get_percent;
@@ -215,7 +216,8 @@ sub mset_thread {
         } ($mset->items) ]});
         my $r = $q->{r};
         my $rootset = PublicInbox::SearchThread::thread($msgs,
-                $r ? sort_relevance(\%pct) : *PublicInbox::View::sort_ts);
+                $r ? sort_relevance(\%pct) : *PublicInbox::View::sort_ts,
+                $srch);
         my $skel = search_nav_bot($mset, $q). "<pre>";
         my $inbox = $ctx->{-inbox};
         $ctx->{-upfx} = '';