From 99def67b86c4d270e8cfda4d1fad418291b6f3a4 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Fri, 7 Aug 2020 01:14:05 +0000 Subject: index: support --xapian-only switch 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. --- lib/PublicInbox/SearchIdxShard.pm | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'lib/PublicInbox/SearchIdxShard.pm') 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); } } -- cgit v1.2.3-24-ge0c7