From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: 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.2 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 64E801FA00 for ; Thu, 11 Mar 2021 10:45:38 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 2/7] searchidx: remove smsg_from_doc Date: Thu, 11 Mar 2021 02:45:33 -0800 Message-Id: <20210311104538.7743-3-e@80x24.org> In-Reply-To: <20210311104538.7743-1-e@80x24.org> References: <20210311104538.7743-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: We no longer read Xapian docdata and favor hitting over.sqlite3, instead, as Xapian is less likely to be available than SQLite. --- lib/PublicInbox/SearchIdx.pm | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/lib/PublicInbox/SearchIdx.pm b/lib/PublicInbox/SearchIdx.pm index 826302de..3372bea5 100644 --- a/lib/PublicInbox/SearchIdx.pm +++ b/lib/PublicInbox/SearchIdx.pm @@ -542,18 +542,6 @@ sub remove_keywords { $self->{xdb}->replace_document($docid, $doc) if $replace; } -sub smsg_from_doc ($) { - my ($doc) = @_; - my $data = $doc->get_data or return; - my $smsg = bless {}, 'PublicInbox::Smsg'; - $smsg->{ts} = int_val($doc, PublicInbox::Search::TS()); - my $dt = int_val($doc, PublicInbox::Search::DT()); - my ($yyyy, $mon, $dd, $hh, $mm, $ss) = unpack('A4A2A2A2A2A2', $dt); - $smsg->{ds} = timegm($ss, $mm, $hh, $dd, $mon - 1, $yyyy); - $smsg->load_from_data($data); - $smsg; -} - sub xdb_remove { my ($self, @docids) = @_; $self->begin_txn_lazy;