about summary refs log tree commit homepage
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/PublicInbox/Search.pm11
-rw-r--r--lib/PublicInbox/Smsg.pm8
2 files changed, 7 insertions, 12 deletions
diff --git a/lib/PublicInbox/Search.pm b/lib/PublicInbox/Search.pm
index e6200bfb..1c648299 100644
--- a/lib/PublicInbox/Search.pm
+++ b/lib/PublicInbox/Search.pm
@@ -324,10 +324,13 @@ sub _enquire_once { # retry_reopen callback
         my $limit = $opts->{limit} || 50;
         my $mset = $enquire->get_mset($offset, $limit);
         return $mset if $opts->{mset};
-        my @msgs = map { PublicInbox::Smsg::from_mitem($_) } $mset->items;
-        return \@msgs unless wantarray;
-
-        ($mset->get_matches_estimated, \@msgs)
+        my $nshard = $self->{nshard} // 1;
+        my $i = 0;
+        my %order = map { mdocid($nshard, $_) => ++$i } $mset->items;
+        my @msgs = sort {
+                $order{$a->{num}} <=> $order{$b->{num}}
+        } @{$self->{over_ro}->get_all(keys %order)};
+        wantarray ? ($mset->get_matches_estimated, \@msgs) : \@msgs;
 }
 
 # read-write
diff --git a/lib/PublicInbox/Smsg.pm b/lib/PublicInbox/Smsg.pm
index f22cd43e..51226b8e 100644
--- a/lib/PublicInbox/Smsg.pm
+++ b/lib/PublicInbox/Smsg.pm
@@ -86,14 +86,6 @@ sub psgi_cull ($) {
         $self;
 }
 
-# Only called by PSGI interface, not NNTP
-sub from_mitem {
-        my ($mitem, $srch) = @_;
-        return $srch->retry_reopen(\&from_mitem, $mitem) if $srch;
-        my $self = bless {}, __PACKAGE__;
-        psgi_cull(load_expand($self, $mitem->get_document));
-}
-
 # for Import and v1 non-SQLite WWW code paths
 sub populate {
         my ($self, $hdr, $sync) = @_;