]> Sergey Matveev's repositories - public-inbox.git/commitdiff
searchidx: index eidx_key as a boolean term
authorEric Wong <e@80x24.org>
Tue, 27 Oct 2020 07:54:21 +0000 (07:54 +0000)
committerEric Wong <e@80x24.org>
Sat, 7 Nov 2020 10:18:52 +0000 (10:18 +0000)
Using `O' (owner) here (according Xapian omega's
termprefixes.rst) since we could say the newsgroup or inbox is
the owner of the given message.

lib/PublicInbox/SearchIdx.pm

index 061a8153e105ec091b5b13c77e41344c98f5978c..5171c610da36a28bd2063baf0f87b06520c53a3a 100644 (file)
@@ -369,6 +369,7 @@ sub add_xapian ($$$$) {
        index_headers($self, $smsg);
 
        if (defined(my $eidx_key = $smsg->{eidx_key})) {
+               $doc->add_boolean_term('O'.$eidx_key);
                $doc->add_boolean_term('P'.
                                "$eidx_key:$smsg->{num}:$smsg->{blob}");
        }
@@ -460,6 +461,7 @@ sub add_xref3 {
        begin_txn_lazy($self);
        my $doc = _get_doc($self, $docid, $oid) or return;
        term_generator($self)->set_document($doc);
+       $doc->add_boolean_term('O'.$eidx_key);
        $doc->add_boolean_term('P'."$eidx_key:$xnum:$oid");
        index_list_id($self, $doc, $eml);
        $self->{xdb}->replace_document($docid, $doc);