From ed2a3c976d8a6d122222f287407d8e3e4d23b3dd Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Tue, 2 Feb 2016 16:25:26 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=89=A7=E8=A1=8Ctask=E6=97=B6=E6=B2=A1?= =?UTF-8?q?=E6=9C=89=E4=BB=A3=E5=85=A5=E7=8E=AF=E5=A2=83=E5=8F=98=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/tasks/elasticsearch_batch_op.rake | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/tasks/elasticsearch_batch_op.rake b/lib/tasks/elasticsearch_batch_op.rake index 91c2ddff9..034887373 100644 --- a/lib/tasks/elasticsearch_batch_op.rake +++ b/lib/tasks/elasticsearch_batch_op.rake @@ -1,12 +1,12 @@ namespace :importer do - task :importuser do + task :importuser => :environment do ENV['CLASS']='User' ENV['SCOPE']='indexable' ENV['FORCE']='y' ENV['BATCH']='1000' Rake::Task["elasticsearch:import:model"].invoke end - task :importproject do + task :importproject => :environment do ENV['CLASS']='Project' ENV['SCOPE']='indexable' @@ -14,21 +14,21 @@ namespace :importer do ENV['BATCH']='1000' Rake::Task["elasticsearch:import:model"].invoke end - task :importcourse do + task :importcourse => :environment do ENV['CLASS']='Course' ENV['SCOPE']='indexable' ENV['FORCE']='y' ENV['BATCH']='1000' Rake::Task["elasticsearch:import:model"].invoke end - task :importattachment do + task :importattachment => :environment do ENV['CLASS']='Attachment' ENV['SCOPE']='indexable' ENV['FORCE']='y' ENV['BATCH']='1000' Rake::Task["elasticsearch:import:model"].invoke end - task :importmemo do + task :importmemo => :environment do ENV['CLASS']='Memo' ENV['SCOPE']='indexable' ENV['FORCE']='y' From 609d98f8a3dbafd37f106c2b9e816f143dfb763f Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Tue, 2 Feb 2016 16:33:08 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E6=89=A7=E8=A1=8Ctask=E6=97=B6=E6=B2=A1?= =?UTF-8?q?=E6=9C=89=E4=BB=A3=E5=85=A5=E7=8E=AF=E5=A2=83=E5=8F=98=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/tasks/elasticsearch_batch_op.rake | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/tasks/elasticsearch_batch_op.rake b/lib/tasks/elasticsearch_batch_op.rake index 034887373..4be382367 100644 --- a/lib/tasks/elasticsearch_batch_op.rake +++ b/lib/tasks/elasticsearch_batch_op.rake @@ -1,4 +1,11 @@ namespace :importer do + 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 task :importuser => :environment do ENV['CLASS']='User' ENV['SCOPE']='indexable'