about summary refs log tree commit homepage
path: root/lib/PublicInbox/SearchIdxShard.pm
diff options
context:
space:
mode:
authorEric Wong <e@yhbt.net>2020-08-07 01:14:05 +0000
committerEric Wong <e@yhbt.net>2020-08-07 23:45:39 +0000
commit99def67b86c4d270e8cfda4d1fad418291b6f3a4 (patch)
tree491a3e58cd7d2cc24c9d44e3a67fd5f1dea476fc /lib/PublicInbox/SearchIdxShard.pm
parent06a2418fd053c9a5b80217e74d1b47b8e1ca85e1 (diff)
downloadpublic-inbox-99def67b86c4d270e8cfda4d1fad418291b6f3a4.tar.gz
This is useful for speeding up indexing runs when only Xapian
rules change but SQLite indexing doesn't change.  This mostly
implies `--reindex', but does NOT pick up new messages (because
SQLite indexing needs to occur for that).

I'm leaving this undocumented in the manpage for now since it's
mainly to speed up development and testing.  Users upgrading to
1.6.0 will be advised to `--reindex --rethread', anyways, due to
the threading improvements since 1.1.0-pre1.

It may make sense to document for 1.7+ when there's Xapian-only
indexing changes, though.
Diffstat (limited to 'lib/PublicInbox/SearchIdxShard.pm')
-rw-r--r--lib/PublicInbox/SearchIdxShard.pm10
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/PublicInbox/SearchIdxShard.pm b/lib/PublicInbox/SearchIdxShard.pm
index cb79f3dc..59b36087 100644
--- a/lib/PublicInbox/SearchIdxShard.pm
+++ b/lib/PublicInbox/SearchIdxShard.pm
@@ -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);
         }
 }