闭社主体 forked from https://github.com/tootsuite/mastodon
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
686 B

  1. # frozen_string_literal: true
  2. require_relative '../../config/boot'
  3. require_relative '../../config/environment'
  4. require_relative 'cli_helper'
  5. module Mastodon
  6. class SearchCLI < Thor
  7. desc 'deploy', 'Create or update an ElasticSearch index and populate it'
  8. long_desc <<~LONG_DESC
  9. If ElasticSearch is empty, this command will create the necessary indices
  10. and then import data from the database into those indices.
  11. This command will also upgrade indices if the underlying schema has been
  12. changed since the last run.
  13. LONG_DESC
  14. def deploy
  15. processed = Chewy::RakeHelper.upgrade
  16. Chewy::RakeHelper.sync(except: processed)
  17. end
  18. end
  19. end