2015-11-27 14:42:25 +08:00
|
|
|
namespace :importer do
|
2016-02-02 16:33:08 +08:00
|
|
|
task :import_all => :environment do
|
|
|
|
Rake::Task["importer:importuser"].execute
|
|
|
|
Rake::Task["importer:importproject"].execute
|
|
|
|
Rake::Task["importer:importcourse"].execute
|
|
|
|
Rake::Task["importer:importattachment"].execute
|
|
|
|
Rake::Task["importer:importmemo"].execute
|
|
|
|
end
|
2016-02-02 16:25:26 +08:00
|
|
|
task :importuser => :environment do
|
2015-11-27 14:42:25 +08:00
|
|
|
ENV['CLASS']='User'
|
|
|
|
ENV['SCOPE']='indexable'
|
|
|
|
ENV['FORCE']='y'
|
|
|
|
ENV['BATCH']='1000'
|
|
|
|
Rake::Task["elasticsearch:import:model"].invoke
|
|
|
|
end
|
2016-02-02 16:25:26 +08:00
|
|
|
task :importproject => :environment do
|
2015-11-27 14:42:25 +08:00
|
|
|
|
|
|
|
ENV['CLASS']='Project'
|
|
|
|
ENV['SCOPE']='indexable'
|
|
|
|
ENV['FORCE']='y'
|
|
|
|
ENV['BATCH']='1000'
|
|
|
|
Rake::Task["elasticsearch:import:model"].invoke
|
|
|
|
end
|
2016-02-02 16:25:26 +08:00
|
|
|
task :importcourse => :environment do
|
2015-11-27 14:42:25 +08:00
|
|
|
ENV['CLASS']='Course'
|
|
|
|
ENV['SCOPE']='indexable'
|
|
|
|
ENV['FORCE']='y'
|
|
|
|
ENV['BATCH']='1000'
|
|
|
|
Rake::Task["elasticsearch:import:model"].invoke
|
|
|
|
end
|
2016-02-02 16:25:26 +08:00
|
|
|
task :importattachment => :environment do
|
2015-11-27 14:42:25 +08:00
|
|
|
ENV['CLASS']='Attachment'
|
|
|
|
ENV['SCOPE']='indexable'
|
|
|
|
ENV['FORCE']='y'
|
|
|
|
ENV['BATCH']='1000'
|
|
|
|
Rake::Task["elasticsearch:import:model"].invoke
|
|
|
|
end
|
2016-02-02 16:25:26 +08:00
|
|
|
task :importmemo => :environment do
|
2015-12-07 14:31:05 +08:00
|
|
|
ENV['CLASS']='Memo'
|
|
|
|
ENV['SCOPE']='indexable'
|
|
|
|
ENV['FORCE']='y'
|
|
|
|
ENV['BATCH']='1000'
|
|
|
|
Rake::Task["elasticsearch:import:model"].invoke
|
|
|
|
end
|
2015-11-27 14:42:25 +08:00
|
|
|
end
|