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 5DC971FAED; Thu, 29 Mar 2018 10:28:31 +0000 (UTC) From: "Eric Wong (Contractor, The Linux Foundation)" To: meta@public-inbox.org Cc: "Eric Wong (Contractor, The Linux Foundation)" Subject: [PATCH 10/14] search: move find_doc_ids to searchidx Date: Thu, 29 Mar 2018 10:28:15 +0000 Message-Id: <20180329102819.15234-11-e@80x24.org> In-Reply-To: <20180329102819.15234-1-e@80x24.org> References: <20180329102819.15234-1-e@80x24.org> List-Id: We do not need this subroutine for read-only use in Search.pm --- lib/PublicInbox/Search.pm | 8 -------- lib/PublicInbox/SearchIdx.pm | 8 ++++++++ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/PublicInbox/Search.pm b/lib/PublicInbox/Search.pm index 7d42aaa..6f5e062 100644 --- a/lib/PublicInbox/Search.pm +++ b/lib/PublicInbox/Search.pm @@ -403,14 +403,6 @@ sub each_smsg_by_mid { } } -# returns begin and end PostingIterator -sub find_doc_ids { - my ($self, $termval) = @_; - my $db = $self->{xdb}; - - ($db->postlist_begin($termval), $db->postlist_end($termval)); -} - # normalize subjects so they are suitable as pathnames for URLs # XXX: consider for removal sub subject_path { diff --git a/lib/PublicInbox/SearchIdx.pm b/lib/PublicInbox/SearchIdx.pm index 446cfb0..a234c8c 100644 --- a/lib/PublicInbox/SearchIdx.pm +++ b/lib/PublicInbox/SearchIdx.pm @@ -389,6 +389,14 @@ sub add_message { $doc_id; } +# returns begin and end PostingIterator +sub find_doc_ids { + my ($self, $termval) = @_; + my $db = $self->{xdb}; + + ($db->postlist_begin($termval), $db->postlist_end($termval)); +} + sub batch_do { my ($self, $termval, $cb) = @_; my $batch_size = 1000; # don't let @ids grow too large to avoid OOM -- EW