socialforge/lib/tasks/elasticsearch_batch_op.rake

49 lines
1.3 KiB
Ruby
Raw Normal View History

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-10-10 09:38:21 +08:00
task :importsyllabus => :environment do
ENV['CLASS']='Syllabus'
2015-11-27 14:42:25 +08:00
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-10-10 09:38:21 +08:00
task :importattachment => :environment do
ENV['CLASS']='Attachment'
2016-10-09 15:05:50 +08:00
ENV['SCOPE']='indexable'
ENV['FORCE']='y'
ENV['BATCH']='1000'
Rake::Task["elasticsearch:import:model"].execute
end
2016-10-10 09:38:21 +08:00
task :importproject => :environment do
ENV['CLASS']='Project'
2015-11-27 14:42:25 +08:00
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"
2016-10-10 09:38:21 +08:00
task :all => [:importuser,:importsyllabus,:importcourse,:importattachment,:importproject,:importmemo]
2015-11-27 14:42:25 +08:00
end