]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/SearchIdxShard.pm
index: support --xapian-only switch
[public-inbox.git] / lib / PublicInbox / SearchIdxShard.pm
index cb79f3dc9dfcb26499232a61beb0ffa778ec0a07..59b360872b3bb4db111b5354b7a5b4b1aecbd41d 100644 (file)
@@ -89,16 +89,20 @@ sub shard_worker_loop ($$$$$) {
 
 # called by V2Writable
 sub index_raw {
-       my ($self, $msgref, $mime, $smsg) = @_;
+       my ($self, $msgref, $eml, $smsg) = @_;
        if (my $w = $self->{w}) {
                # mid must be last, it can contain spaces (but not LF)
                print $w join(' ', @$smsg{qw(raw_bytes bytes
                                                num blob ds ts mid)}),
                        "\n", $$msgref or die "failed to write shard $!\n";
        } else {
-               $$msgref = undef;
+               if ($eml) {
+                       $$msgref = undef;
+               } else { # --xapian-only + --sequential-shard:
+                       $eml = PublicInbox::Eml->new($msgref);
+               }
                $self->begin_txn_lazy;
-               $self->add_message($mime, $smsg);
+               $self->add_message($eml, $smsg);
        }
 }