From 9ff904a5b93dcc7989e475e2296ff13fe530d547 Mon Sep 17 00:00:00 2001 From: "Eric Wong (Contractor, The Linux Foundation)" Date: Wed, 18 Apr 2018 09:13:16 +0000 Subject: [PATCH] searchidx: increase term positions for all text terms We do not want phrase searches to cross between independent fields (filenames/Message-ID vs bodies) --- lib/PublicInbox/SearchIdx.pm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/PublicInbox/SearchIdx.pm b/lib/PublicInbox/SearchIdx.pm index 2239c902..6e44887d 100644 --- a/lib/PublicInbox/SearchIdx.pm +++ b/lib/PublicInbox/SearchIdx.pm @@ -295,6 +295,7 @@ sub add_message { my $fn = $part->filename; if (defined $fn && $fn ne '') { $tg->index_text($fn, 1, 'XFN'); + $tg->increase_termpos; } return if $ct =~ m!\btext/x?html\b!i; @@ -330,6 +331,7 @@ sub add_message { foreach my $mid (@$mids) { $tg->index_text($mid, 1, 'XM'); + $tg->increase_termpos; } $smsg->{to} = $smsg->{cc} = ''; PublicInbox::OverIdx::parse_references($smsg, $mid0, $mids); -- 2.44.0