]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/SearchIdx.pm
search: index UID for IMAP search, too
[public-inbox.git] / lib / PublicInbox / SearchIdx.pm
index f10a9104e789fe82beae8e8a7b98d3ec9932f6c9..3df7970ebf984252f006056042946425e8ef7335 100644 (file)
@@ -341,6 +341,8 @@ sub add_xapian ($$$$) {
        add_val($doc, PublicInbox::Search::YYYYMMDD(), $yyyymmdd);
        my $dt = strftime('%Y%m%d%H%M%S', @ds);
        add_val($doc, PublicInbox::Search::DT(), $dt);
+       add_val($doc, PublicInbox::Search::BYTES(), $smsg->{bytes});
+       add_val($doc, PublicInbox::Search::UID(), $smsg->{num});
 
        my $tg = term_generator($self);
        $tg->set_document($doc);
@@ -388,6 +390,7 @@ sub add_message {
 
        # v1 and tests only:
        $smsg->populate($hdr, $self);
+       $smsg->{bytes} //= length($mime->as_string);
 
        eval {
                # order matters, overview stores every possible piece of
@@ -752,10 +755,7 @@ sub _index_sync {
        my $xdb = $self->begin_txn_lazy;
        my $mm = _msgmap_init($self);
        do {
-               if ($xlog) {
-                       close($xlog) or die "git log failed: \$?=$?";
-                       $xlog = undef;
-               }
+               $xlog = undef; # stop previous git-log via SIGPIPE
                $last_commit = _last_x_commit($self, $mm);
                $lx = reindex_from($opts->{reindex}, $last_commit);