From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,AWL,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id D038820082 for ; Tue, 27 Oct 2020 07:54:56 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 20/52] searchidx: index eidx_key as a boolean term Date: Tue, 27 Oct 2020 07:54:21 +0000 Message-Id: <20201027075453.19163-21-e@80x24.org> In-Reply-To: <20201027075453.19163-1-e@80x24.org> References: <20201027075453.19163-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: 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 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/PublicInbox/SearchIdx.pm b/lib/PublicInbox/SearchIdx.pm index 061a8153..5171c610 100644 --- a/lib/PublicInbox/SearchIdx.pm +++ b/lib/PublicInbox/SearchIdx.pm @@ -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);