user/dev discussion of public-inbox itself
 help / color / mirror / code / Atom feed
* [PATCH] lei_search: ignore Resent-Message-ID for indexing
@ 2021-04-04 17:38 Eric Wong
  0 siblings, 0 replies; only message in thread
From: Eric Wong @ 2021-04-04 17:38 UTC (permalink / raw)
  To: meta

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: <y@y>
+Resent-Message-ID: <resent-test@example>
 
 No use for a name
 EOM

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-04-04 17:38 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-04 17:38 [PATCH] lei_search: ignore Resent-Message-ID for indexing Eric Wong

user/dev discussion of public-inbox itself

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://public-inbox.org/meta
	git clone --mirror http://czquwvybam4bgbro.onion/meta
	git clone --mirror http://hjrcffqmbrq6wope.onion/meta
	git clone --mirror http://ou63pmih66umazou.onion/meta

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V1 meta meta/ http://public-inbox.org/meta \
		meta@public-inbox.org
	public-inbox-index meta

Example config snippet for mirrors.
Newsgroups are available over NNTP:
	nntp://news.public-inbox.org/inbox.comp.mail.public-inbox.meta
	nntp://ou63pmih66umazou.onion/inbox.comp.mail.public-inbox.meta
	nntp://czquwvybam4bgbro.onion/inbox.comp.mail.public-inbox.meta
	nntp://hjrcffqmbrq6wope.onion/inbox.comp.mail.public-inbox.meta
	nntp://news.gmane.io/gmane.mail.public-inbox.general
 note: .onion URLs require Tor: https://www.torproject.org/

code repositories for project(s) associated with this inbox:

	https://80x24.org/public-inbox.git

AGPL code for this site: git clone https://public-inbox.org/public-inbox.git