]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/SearchIdx.pm
treewide: "require" + "use" cleanup and docs
[public-inbox.git] / lib / PublicInbox / SearchIdx.pm
index 47537ed47b1b69eb7b03c2f7db46277f748f733c..f14809d25fe361a827dc3f18a21e14a594594f2b 100644 (file)
@@ -12,7 +12,7 @@ use warnings;
 use base qw(PublicInbox::Search PublicInbox::Lock);
 use PublicInbox::MIME;
 use PublicInbox::InboxWritable;
-use PublicInbox::MID qw/mid_clean id_compress mid_mime mids_for_index/;
+use PublicInbox::MID qw/mid_clean mid_mime mids_for_index/;
 use PublicInbox::MsgIter;
 use Carp qw(croak);
 use POSIX qw(strftime);
@@ -144,14 +144,14 @@ sub term_generator ($) { # write-only
 }
 
 sub index_text ($$$$) {
-       my ($self, $field, $n, $text) = @_;
-       my $tg = term_generator($self);
+       my ($self, $text, $wdf_inc, $prefix) = @_;
+       my $tg = term_generator($self); # man Search::Xapian::TermGenerator
 
        if ($self->{indexlevel} eq 'full') {
-               $tg->index_text($field, $n, $text);
+               $tg->index_text($text, $wdf_inc, $prefix);
                $tg->increase_termpos;
        } else {
-               $tg->index_text_without_positions($field, $n, $text);
+               $tg->index_text_without_positions($text, $wdf_inc, $prefix);
        }
 }
 
@@ -433,7 +433,7 @@ sub remove_message {
                batch_do($self, 'Q' . $mid, sub {
                        my ($ids) = @_;
                        $db->delete_document($_) for @$ids;
-                       $nr = scalar @$ids;
+                       $nr += scalar @$ids;
                });
        };
        if ($@) {