]> Sergey Matveev's repositories - public-inbox.git/commitdiff
search: query_xover uses skeleton DB iff available
authorEric Wong (Contractor, The Linux Foundation) <e@80x24.org>
Tue, 27 Feb 2018 08:29:09 +0000 (08:29 +0000)
committerEric Wong (Contractor, The Linux Foundation) <e@80x24.org>
Wed, 28 Feb 2018 23:06:20 +0000 (23:06 +0000)
The skeleton DB is where we store all the information needed
for NNTP overviews via XOVER.  This seems to be the only change
necessary (besides eventually handling duplicates) necessary
to support our nntpd interface for v2 repositories.

lib/PublicInbox/Search.pm

index 6b14942a1045cda131e8b66347e72b7a0db2e0a7..a796cf654a76f9ce48446082d24ea6e3f0ca4189 100644 (file)
@@ -317,11 +317,17 @@ sub num_range_processor {
 sub query_xover {
        my ($self, $beg, $end, $offset) = @_;
        my $qp = Search::Xapian::QueryParser->new;
-       $qp->set_database($self->{xdb});
+       $qp->set_database($self->{skel} || $self->{xdb});
        $qp->add_valuerangeprocessor($self->num_range_processor);
        my $query = $qp->parse_query("$beg..$end", QP_FLAGS);
 
-       _do_enquire($self, $query, {num => 1, limit => 200, offset => $offset});
+       my $opts = {
+               enquire => enquire_skel($self),
+               num => 1,
+               limit => 200,
+               offset => $offset,
+       };
+       _do_enquire($self, $query, $opts);
 }
 
 sub lookup_skeleton {