]> Sergey Matveev's repositories - public-inbox.git/commitdiff
searchidx: index lower-case List-Id value
authorEric Wong <e@80x24.org>
Mon, 28 Sep 2020 05:15:19 +0000 (05:15 +0000)
committerEric Wong <e@80x24.org>
Sat, 26 Dec 2020 19:36:03 +0000 (19:36 +0000)
We don't want a List-Id value being confused with a Xapian
term prefix, here.

Followup-to: 8b06cda3a3af3f0e ("mda: match List-Id insensitively")
(cherry picked from commit 447d049b70c6723a0de8e28aa7db1a4130394c4b)

lib/PublicInbox/SearchIdx.pm

index eb620f44fe990e4c38514d9375fa6328ae30e80d..c36fc6c7dee5307ea803ec17f17ac8af7eb10dc8 100644 (file)
@@ -338,7 +338,7 @@ sub index_ids ($$$$) {
        $doc->add_boolean_term('Q' . $_) for @$mids;
        for my $l ($hdr->header_raw('List-Id')) {
                $l =~ /<([^>]+)>/ or next;
-               my $lid = $1;
+               my $lid = lc $1;
                $doc->add_boolean_term('G' . $lid);
                index_text($self, $lid, 1, 'XL'); # probabilistic
        }