Enhacement: Xapian parse eml and msg files in same way as word, excel... #717

This commit is contained in:
Karel Picman 2017-05-02 13:36:47 +02:00
parent 6f671b509c
commit 0e72eb76f0

View File

@ -368,10 +368,10 @@ def add_or_update_index(databasepath, indexconf, project, repository, identifier
uri = generate_uri(project, repository, identifier, path) uri = generate_uri(project, repository, identifier, path)
return unless uri return unless uri
text = nil text = nil
if Redmine::MimeType.is_type?('text', path) #type eq 'txt' if Redmine::MimeType.is_type?('text', path) || (%(js msg eml).include?(type))
text = repository.cat(path, identifier) text = repository.cat(path, identifier)
else else
fname = path.split( '/').last.tr(' ', '_') fname = path.split('/').last.tr(' ', '_')
bstr = nil bstr = nil
bstr = repository.cat(path, identifier) bstr = repository.cat(path, identifier)
File.open( "#{$tempdir}/#{fname}", 'wb+') do | bs | File.open( "#{$tempdir}/#{fname}", 'wb+') do | bs |