Add search deploy date options
This commit is contained in:
parent
173b9f4fd7
commit
0ffd8acacd
4 changed files with 12 additions and 3 deletions
|
@ -21,6 +21,8 @@ module Mastodon::CLI
|
|||
option :clean, type: :boolean, default: true, desc: 'Remove outdated documents from the index'
|
||||
option :reset_chewy, type: :boolean, default: false, desc: "Reset Chewy's internal index"
|
||||
option :full, type: :boolean, default: false, desc: 'Import full data over Mastodon default importer'
|
||||
option :from, type: :string, default: nil, desc: 'Statuses start date'
|
||||
option :to, type: :string, default: nil, desc: 'Statuses end date'
|
||||
desc 'deploy', 'Create or upgrade Elasticsearch indices and populate them'
|
||||
long_desc <<~LONG_DESC
|
||||
If Elasticsearch is empty, this command will create the necessary indices
|
||||
|
@ -42,7 +44,7 @@ module Mastodon::CLI
|
|||
end
|
||||
|
||||
pool = Concurrent::FixedThreadPool.new(options[:concurrency], max_queue: options[:concurrency] * 10)
|
||||
importers = indices.index_with { |index| "Importer::#{index.name}Importer".constantize.new(batch_size: options[:batch_size], executor: pool, full: options[:full]) }
|
||||
importers = indices.index_with { |index| "Importer::#{index.name}Importer".constantize.new(batch_size: options[:batch_size], executor: pool, full: options[:full], from: options[:from], to: options[:to]) }
|
||||
progress = ProgressBar.create(total: nil, format: '%t%c/%u |%b%i| %e (%r docs/s)', autofinish: false)
|
||||
|
||||
Chewy::Stash::Specification.reset! if options[:reset_chewy]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue