2015-11-27 14:42:25 +08:00
|
|
|
namespace :importer do
|
2016-02-02 19:16:15 +08:00
|
|
|
|
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'
|
2016-02-02 19:16:15 +08:00
|
|
|
Rake::Task["elasticsearch:import:model"].execute
|
2015-11-27 14:42:25 +08:00
|
|
|
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'
|
2016-02-02 19:16:15 +08:00
|
|
|
Rake::Task["elasticsearch:import:model"].execute
|
2015-11-27 14:42:25 +08:00
|
|
|
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'
|
2016-02-02 19:16:15 +08:00
|
|
|
Rake::Task["elasticsearch:import:model"].execute
|
2015-11-27 14:42:25 +08:00
|
|
|
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'
|
2016-02-02 19:16:15 +08:00
|
|
|
Rake::Task["elasticsearch:import:model"].execute
|
2015-11-27 14:42:25 +08:00
|
|
|
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'
|
2016-02-02 19:16:15 +08:00
|
|
|
Rake::Task["elasticsearch:import:model"].execute
|
2015-12-07 14:31:05 +08:00
|
|
|
end
|
2016-02-02 19:16:15 +08:00
|
|
|
|
|
|
|
desc "Run all tasks"
|
|
|
|
task :all => [:importuser,:importproject,:importcourse,:importattachment,:importmemo]
|
2015-11-27 14:42:25 +08:00
|
|
|
end
|