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-ASN: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,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 7ED801F4B4 for ; Sun, 4 Apr 2021 17:38:07 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH] lei_search: ignore Resent-Message-ID for indexing Date: Sun, 4 Apr 2021 22:38:07 +0500 Message-Id: <20210404173807.29807-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: It currently conflicts with the way OverIdx and SearchIdx index messages, ultimately leading to violating a NOT NULL constraint on id2num.id in over.sqlite3. We may allow searching Resent-* fields separately, though I'm not sure how useful it'll be. --- lib/PublicInbox/LeiSearch.pm | 5 ++--- t/lei-import.t | 1 + 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/PublicInbox/LeiSearch.pm b/lib/PublicInbox/LeiSearch.pm index 148aa185..082176e7 100644 --- a/lib/PublicInbox/LeiSearch.pm +++ b/lib/PublicInbox/LeiSearch.pm @@ -8,7 +8,7 @@ use v5.10.1; use parent qw(PublicInbox::ExtSearch); use PublicInbox::Search qw(xap_terms); use PublicInbox::ContentHash qw(content_digest content_hash); -use PublicInbox::MID qw(mids mids_in); +use PublicInbox::MID qw(mids mids_for_index); # get combined docid from over.num: # (not generic Xapian, only works with our sharding scheme) @@ -54,8 +54,7 @@ sub content_key ($) { my ($eml) = @_; my $dig = content_digest($eml); my $chash = $dig->clone->digest; - my $mids = mids_in($eml, - qw(Message-ID X-Alt-Message-ID Resent-Message-ID)); + my $mids = mids_for_index($eml); unless (@$mids) { $eml->{-lei_fake_mid} = $mids->[0] = PublicInbox::Import::digest2mid($dig, $eml, 0); diff --git a/t/lei-import.t b/t/lei-import.t index 9bb4e1fa..8635df5a 100644 --- a/t/lei-import.t +++ b/t/lei-import.t @@ -83,6 +83,7 @@ is_deeply($res->[0]->{kw}, ['seen'], "`seen' keywords set"); $eml_str = <<'EOM'; Subject: draft message with no sender References: +Resent-Message-ID: No use for a name EOM