diff options
author | Eric Wong (Contractor, The Linux Foundation) <e@80x24.org> | 2018-03-05 23:13:47 +0000 |
---|---|---|
committer | Eric Wong (Contractor, The Linux Foundation) <e@80x24.org> | 2018-03-06 04:51:14 +0000 |
commit | 589355867a4fcaf25a9db43c4c5dcc9a1e32ec1e (patch) | |
tree | 75992cc2f300a48f63d58498a2b5747bbb7fe38e /lib/PublicInbox/Search.pm | |
parent | 9825426219e7772f1e44840dd2cdf548bf73ad63 (diff) | |
download | public-inbox-589355867a4fcaf25a9db43c4c5dcc9a1e32ec1e.tar.gz |
We do not need the large DBs for MID scans.
Diffstat (limited to 'lib/PublicInbox/Search.pm')
-rw-r--r-- | lib/PublicInbox/Search.pm | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/PublicInbox/Search.pm b/lib/PublicInbox/Search.pm index dc46ead0..7cad31a7 100644 --- a/lib/PublicInbox/Search.pm +++ b/lib/PublicInbox/Search.pm @@ -409,13 +409,15 @@ sub lookup_article { sub each_smsg_by_mid { my ($self, $mid, $cb) = @_; - my $xdb = $self->{xdb}; # XXX retry_reopen isn't necessary for V2Writable, but the PSGI # interface will need it... - my ($head, $tail) = $self->find_doc_ids('Q' . $mid); + my $db = $self->{skel} || $self->{xdb}; + my $term = 'Q' . $mid; + my $head = $db->postlist_begin($term); + my $tail = $db->postlist_end($term); for (; $head->nequal($tail); $head->inc) { my $doc_id = $head->get_docid; - my $doc = $xdb->get_document($doc_id); + my $doc = $db->get_document($doc_id); my $smsg = PublicInbox::SearchMsg->wrap($doc, $mid); $smsg->{doc_id} = $doc_id; $cb->($smsg) or return; |