about summary refs log tree commit homepage
path: root/lib/PublicInbox
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2016-09-09 00:01:31 +0000
committerEric Wong <e@80x24.org>2016-09-09 00:02:27 +0000
commit0df58f99a71268c98bb21cab0a98ddd25a5b83b2 (patch)
treef88df5a32005f029e3ee83b7d848cf7922b3139b /lib/PublicInbox
parent0cf6196025d4e4880cd1ed859257ce21dd3cdcf6 (diff)
downloadpublic-inbox-0df58f99a71268c98bb21cab0a98ddd25a5b83b2.tar.gz
And while we're at it, ensure searching inside displayable
attachment bodies works.
Diffstat (limited to 'lib/PublicInbox')
-rw-r--r--lib/PublicInbox/Search.pm3
-rw-r--r--lib/PublicInbox/SearchIdx.pm4
2 files changed, 6 insertions, 1 deletions
diff --git a/lib/PublicInbox/Search.pm b/lib/PublicInbox/Search.pm
index ceee39af..0c056772 100644
--- a/lib/PublicInbox/Search.pm
+++ b/lib/PublicInbox/Search.pm
@@ -69,6 +69,7 @@ my %prob_prefix = (
         tcf => 'XTO XCC A',
         b => 'XNQ XQUOT',
         bs => 'XNQ XQUOT S',
+        n => 'XFN',
 
         # n.b.: leaving out "a:" alias for "tcf:" even though
         # mairix supports it.  It is only mentioned in passing in mairix(1)
@@ -77,7 +78,7 @@ my %prob_prefix = (
         nq => 'XNQ',
 
         # default:
-        '' => 'XMID S A XNQ XQUOT',
+        '' => 'XMID S A XNQ XQUOT XFN',
 );
 
 # not documenting m: and mid: for now, the using the URLs works w/o Xapian
diff --git a/lib/PublicInbox/SearchIdx.pm b/lib/PublicInbox/SearchIdx.pm
index fb68f4b1..23aef9f3 100644
--- a/lib/PublicInbox/SearchIdx.pm
+++ b/lib/PublicInbox/SearchIdx.pm
@@ -181,6 +181,10 @@ sub add_message {
                 msg_iter($mime, sub {
                         my ($part, $depth, @idx) = @{$_[0]};
                         my $ct = $part->content_type || 'text/plain';
+                        my $fn = $part->filename;
+                        if (defined $fn && $fn ne '') {
+                                $tg->index_text($fn, 1, 'XFN');
+                        }
 
                         return if $ct =~ m!\btext/x?html\b!i;