]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/SearchIdx.pm
msg_iter: pass $idx as a scalar, not array
[public-inbox.git] / lib / PublicInbox / SearchIdx.pm
index 25118f436139baab6fbfd5c3df13700e92e2241f..f357a8fa5f2ea4c95fed69a73b22b993eba8387f 100644 (file)
@@ -277,7 +277,7 @@ sub index_diff ($$$) {
 }
 
 sub index_xapian { # msg_iter callback
-       my $part = $_[0]->[0]; # ignore $depth and @idx
+       my $part = $_[0]->[0]; # ignore $depth and $idx
        my ($self, $doc) = @{$_[1]};
        my $ct = $part->content_type || 'text/plain';
        my $fn = $part->filename;
@@ -352,6 +352,12 @@ sub add_xapian ($$$$) {
                }
        }
        $doc->add_boolean_term('Q' . $_) foreach @$mids;
+       for my $l ($hdr->header_raw('List-Id')) {
+               $l =~ /<([^>]+)>/ or next;
+               my $lid = $1;
+               $doc->add_boolean_term('G' . $lid);
+               index_text($self, $lid, 1, 'XL'); # probabilistic
+       }
        $self->{xdb}->replace_document($smsg->{num}, $doc);
 }