diff options
-rw-r--r-- | lib/kkuleomi/store.rb | 2 | ||||
-rw-r--r-- | lib/tasks/kkuleomi.rake | 4 |
2 files changed, 5 insertions, 1 deletions
diff --git a/lib/kkuleomi/store.rb b/lib/kkuleomi/store.rb index 9640a87..ff8cb40 100644 --- a/lib/kkuleomi/store.rb +++ b/lib/kkuleomi/store.rb @@ -13,7 +13,7 @@ module Kkuleomi::Store # In ES 1.5, we could use 1 mega-index. But in ES6, each model needs its own. repositories.each { |repository| - repository.instance.create_index!(force: true, settings: settings) + repository.instance.create_index!(force: _force, settings: settings) } end end diff --git a/lib/tasks/kkuleomi.rake b/lib/tasks/kkuleomi.rake index 9362b7a..45d9283 100644 --- a/lib/tasks/kkuleomi.rake +++ b/lib/tasks/kkuleomi.rake @@ -2,6 +2,10 @@ namespace :kkuleomi do namespace :index do desc '(Re-)Initializes the ElasticSearch index' task init: :environment do + Kkuleomi::Store.create_index false + end + + task recreate: :environment do Kkuleomi::Store.create_index true end end |