about summary refs log tree commit homepage
path: root/lib/PublicInbox/SearchIdx.pm
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/SearchIdx.pm
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/SearchIdx.pm')
-rw-r--r--lib/PublicInbox/SearchIdx.pm4
1 files changed, 4 insertions, 0 deletions
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;