X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=lib%2FPublicInbox%2FSearchIdx.pm;h=4dc81352f535568d7673cabb8d6ad6fff5cb859b;hb=88057373c20150001b3f944c33fd7577a74bab85;hp=2239c90209579e42c590c8e0df113ab53617879b;hpb=017fed7bc4d33ac474a19356994be5bd0bfe68ba;p=public-inbox.git diff --git a/lib/PublicInbox/SearchIdx.pm b/lib/PublicInbox/SearchIdx.pm index 2239c902..4dc81352 100644 --- a/lib/PublicInbox/SearchIdx.pm +++ b/lib/PublicInbox/SearchIdx.pm @@ -22,7 +22,7 @@ require PublicInbox::Git; use Compress::Zlib qw(compress); use constant { - BATCH_BYTES => 10_000_000, + BATCH_BYTES => 1_000_000, DEBUG => !!$ENV{DEBUG}, }; @@ -295,6 +295,7 @@ sub add_message { my $fn = $part->filename; if (defined $fn && $fn ne '') { $tg->index_text($fn, 1, 'XFN'); + $tg->increase_termpos; } return if $ct =~ m!\btext/x?html\b!i; @@ -330,6 +331,7 @@ sub add_message { foreach my $mid (@$mids) { $tg->index_text($mid, 1, 'XM'); + $tg->increase_termpos; } $smsg->{to} = $smsg->{cc} = ''; PublicInbox::OverIdx::parse_references($smsg, $mid0, $mids); @@ -549,16 +551,11 @@ sub read_log { my %D; my $line; my $newest; - my $mid = '20170114215743.5igbjup6qpsh3jfg@genre.crustytoothpaste.net'; while (defined($line = <$log>)) { if ($line =~ /$addmsg/o) { my $blob = $1; delete $D{$blob} and next; my $mime = do_cat_mail($git, $blob, \$bytes) or next; - my $mids = mids($mime->header_obj); - foreach (@$mids) { - warn "ADD $mid\n" if ($_ eq $mid); - } batch_adjust(\$max, $bytes, $batch_cb, $latest); $add_cb->($self, $mime, $bytes, $blob); } elsif ($line =~ /$delmsg/o) { @@ -572,10 +569,6 @@ sub read_log { # get the leftovers foreach my $blob (keys %D) { my $mime = do_cat_mail($git, $blob, \$bytes) or next; - my $mids = mids($mime->header_obj); - foreach (@$mids) { - warn "DEL $mid\n" if ($_ eq $mid); - } $del_cb->($self, $mime); } $batch_cb->($latest, $newest); @@ -696,6 +689,7 @@ sub _index_sync { } } $self->commit_txn_lazy; + $xdb = _xdb_release($self); # let another process do some work... < if (!$newest) { $xdb = $self->begin_txn_lazy;