From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.0 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 4391D1FAF7 for ; Wed, 28 Feb 2018 23:42:09 +0000 (UTC) From: "Eric Wong (Contractor, The Linux Foundation)" To: meta@public-inbox.org Subject: [PATCH 20/21] search: query_xover uses skeleton DB iff available Date: Wed, 28 Feb 2018 23:42:01 +0000 Message-Id: <20180228234202.8839-21-e@80x24.org> In-Reply-To: <20180228234202.8839-1-e@80x24.org> References: <20180228234202.8839-1-e@80x24.org> List-Id: 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 | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/PublicInbox/Search.pm b/lib/PublicInbox/Search.pm index 6b14942..a796cf6 100644 --- a/lib/PublicInbox/Search.pm +++ b/lib/PublicInbox/Search.pm @@ -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 { -- EW