]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/SearchIdx.pm
thread: remove Mail::Thread dependency
[public-inbox.git] / lib / PublicInbox / SearchIdx.pm
index fb68f4b12a66878dbe53108194fbea4396e6ce2c..4aac0281304146c39e2eb4d25cf8575c121a84a0 100644 (file)
@@ -4,8 +4,8 @@
 #
 # Indexes mail with Xapian and our (SQLite-based) ::Msgmap for use
 # with the web and NNTP interfaces.  This index maintains thread
-# relationships for use by Mail::Thread.  This writes to the search
-# index.
+# relationships for use by PublicInbox::SearchThread.
+# This writes to the search index.
 package PublicInbox::SearchIdx;
 use strict;
 use warnings;
@@ -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;