49 lines
1.3 KiB
Ruby
49 lines
1.3 KiB
Ruby
namespace :importer do
|
|
|
|
task :importuser => :environment do
|
|
ENV['CLASS']='User'
|
|
ENV['SCOPE']='indexable'
|
|
ENV['FORCE']='y'
|
|
ENV['BATCH']='1000'
|
|
Rake::Task["elasticsearch:import:model"].execute
|
|
end
|
|
task :importsyllabus => :environment do
|
|
ENV['CLASS']='Syllabus'
|
|
ENV['SCOPE']='indexable'
|
|
ENV['FORCE']='y'
|
|
ENV['BATCH']='1000'
|
|
Rake::Task["elasticsearch:import:model"].execute
|
|
end
|
|
task :importcourse => :environment do
|
|
ENV['CLASS']='Course'
|
|
ENV['SCOPE']='indexable'
|
|
ENV['FORCE']='y'
|
|
ENV['BATCH']='1000'
|
|
Rake::Task["elasticsearch:import:model"].execute
|
|
end
|
|
task :importattachment => :environment do
|
|
ENV['CLASS']='Attachment'
|
|
ENV['SCOPE']='indexable'
|
|
ENV['FORCE']='y'
|
|
ENV['BATCH']='1000'
|
|
Rake::Task["elasticsearch:import:model"].execute
|
|
end
|
|
task :importproject => :environment do
|
|
|
|
ENV['CLASS']='Project'
|
|
ENV['SCOPE']='indexable'
|
|
ENV['FORCE']='y'
|
|
ENV['BATCH']='1000'
|
|
Rake::Task["elasticsearch:import:model"].execute
|
|
end
|
|
task :importmemo => :environment do
|
|
ENV['CLASS']='Memo'
|
|
ENV['SCOPE']='indexable'
|
|
ENV['FORCE']='y'
|
|
ENV['BATCH']='1000'
|
|
Rake::Task["elasticsearch:import:model"].execute
|
|
end
|
|
|
|
desc "Run all tasks"
|
|
task :all => [:importuser,:importsyllabus,:importcourse,:importattachment,:importproject,:importmemo]
|
|
end |