]> Sergey Matveev's repositories - public-inbox.git/commitdiff
searchidx: remove smsg_from_doc
authorEric Wong <e@80x24.org>
Thu, 11 Mar 2021 10:45:33 +0000 (02:45 -0800)
committerEric Wong <e@80x24.org>
Thu, 11 Mar 2021 20:35:10 +0000 (16:35 -0400)
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

index 826302dec1270ca498e455239beabe39260b9ba5..3372bea5bb67cc649497584aa7b37bc3c24cb268 100644 (file)
@@ -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;