|
package SL::BackgroundJob::CreateOrUpdateFileFullTexts;
|
|
|
|
use strict;
|
|
|
|
use parent qw(SL::BackgroundJob::Base);
|
|
|
|
use Encode qw(decode);
|
|
use English qw( -no_match_vars );
|
|
use File::Slurp qw(read_file);
|
|
use List::MoreUtils qw(uniq);
|
|
use IPC::Run qw();
|
|
use Unicode::Normalize qw();
|
|
|
|
use SL::DB::File;
|
|
use SL::DB::FileFullText;
|
|
use SL::HTML::Util;
|
|
|
|
my %extractor_by_mime_type = (
|
|
'application/pdf' => \&_pdf_to_strings,
|
|
'text/html' => \&_html_to_strings,
|
|
'text/plain' => \&_text_to_strings,
|
|
);
|
|
|
|
sub create_job {
|
|
$_[0]->create_standard_job |