]> Sergey Matveev's repositories - public-inbox.git/commitdiff
search: remove mdocid export
authorEric Wong <e@80x24.org>
Fri, 4 Dec 2020 22:03:47 +0000 (22:03 +0000)
committerEric Wong <e@80x24.org>
Sat, 5 Dec 2020 21:41:52 +0000 (21:41 +0000)
There's no need to export it, as shown by the change to
SearchView.  This should pave the way to making search
more flexible and allow per-Inbox search to reuse ->ALL.

lib/PublicInbox/Search.pm
lib/PublicInbox/SearchView.pm

index 574bc145681a95991f75e1f797efd2c059ad2d08..7e72913f77e6444d830e963d70a6cce11372fa17 100644 (file)
@@ -6,7 +6,7 @@
 package PublicInbox::Search;
 use strict;
 use parent qw(Exporter);
-our @EXPORT_OK = qw(mdocid retry_reopen);
+our @EXPORT_OK = qw(retry_reopen);
 use List::Util qw(max);
 
 # values for searching, changing the numeric value breaks
index c482f1c9ba306efd2f1879686de2721a75b1068e..26426c0114687f91e031cbf8bb1790765de42863 100644 (file)
@@ -14,7 +14,7 @@ use PublicInbox::WwwAtomStream;
 use PublicInbox::WwwStream qw(html_oneshot);
 use PublicInbox::SearchThread;
 use PublicInbox::SearchQuery;
-use PublicInbox::Search qw(mdocid);
+use PublicInbox::Search;
 my %rmap_inc;
 
 sub mbox_results {
@@ -287,13 +287,12 @@ sub get_pct ($) {
 sub mset_thread {
        my ($ctx, $mset, $q) = @_;
        my $ibx = $ctx->{-inbox};
-       my $nshard = $ibx->search->{nshard} // 1;
-       my %pct = map { mdocid($nshard, $_) => get_pct($_) } $mset->items;
-       my $msgs = $ibx->over->get_all(keys %pct);
-       $_->{pct} = $pct{$_->{num}} for @$msgs;
+       my @pct = map { get_pct($_) } $mset->items;
+       my $msgs = $ibx->search->mset_to_smsg($ibx, $mset);
+       my $i = 0;
+       $_->{pct} = $pct[$i++] for @$msgs;
        my $r = $q->{r};
        if ($r) { # for descriptions in search_nav_bot
-               my @pct = values %pct;
                $q->{-min_pct} = min(@pct);
                $q->{-max_pct} = max(@pct);
        }