about summary refs log tree commit homepage
path: root/lib/PublicInbox/SearchIdx.pm
diff options
context:
space:
mode:
authorEric Wong <e@yhbt.net>2020-05-07 03:00:09 +0000
committerEric Wong <e@yhbt.net>2020-05-09 00:54:34 +0000
commitb714ab45d30d6f0298d73ef4281c1d0263a02493 (patch)
treef5d3c3b64d9e04811cb372785ca950bddf301307 /lib/PublicInbox/SearchIdx.pm
parentc2bc9ebcb770a27823d8e989707f434826333b0e (diff)
downloadpublic-inbox-b714ab45d30d6f0298d73ef4281c1d0263a02493.tar.gz
We'll support both probabilistic matches via `l:' and boolean
matches via `lid:' for exact matches, similar to how both `m:'
and `mid:' are supported.  Only text inside angle braces (`<'
and `>') are supported, since I'm not sure if there's value in
searching on the optional phrases (which would require decoding
with ->header_str instead of ->header_raw).
Diffstat (limited to 'lib/PublicInbox/SearchIdx.pm')
-rw-r--r--lib/PublicInbox/SearchIdx.pm6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/PublicInbox/SearchIdx.pm b/lib/PublicInbox/SearchIdx.pm
index 25118f43..998341a7 100644
--- a/lib/PublicInbox/SearchIdx.pm
+++ b/lib/PublicInbox/SearchIdx.pm
@@ -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);
 }