File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55require_relative 'mastodon/emoji_cli'
66require_relative 'mastodon/accounts_cli'
77require_relative 'mastodon/feeds_cli'
8+ require_relative 'mastodon/search_cli'
89require_relative 'mastodon/settings_cli'
910require_relative 'mastodon/statuses_cli'
1011require_relative 'mastodon/domains_cli'
@@ -28,6 +29,9 @@ def self.exit_on_failure?
2829 desc 'feeds SUBCOMMAND ...ARGS' , 'Manage feeds'
2930 subcommand 'feeds' , Mastodon ::FeedsCLI
3031
32+ desc 'search SUBCOMMAND ...ARGS' , 'Manage the search engine'
33+ subcommand 'search' , Mastodon ::SearchCLI
34+
3135 desc 'settings SUBCOMMAND ...ARGS' , 'Manage dynamic settings'
3236 subcommand 'settings' , Mastodon ::SettingsCLI
3337
Original file line number Diff line number Diff line change 1+ # frozen_string_literal: true
2+
3+ require_relative '../../config/boot'
4+ require_relative '../../config/environment'
5+ require_relative 'cli_helper'
6+
7+ module Mastodon
8+ class SearchCLI < Thor
9+ desc 'deploy' , 'Create or update an ElasticSearch index and populate it'
10+ long_desc <<~LONG_DESC
11+ If ElasticSearch is empty, this command will create the necessary indices
12+ and then import data from the database into those indices.
13+
14+ This command will also upgrade indices if the underlying schema has been
15+ changed since the last run.
16+ LONG_DESC
17+ def deploy
18+ processed = Chewy ::RakeHelper . upgrade
19+ Chewy ::RakeHelper . sync ( except : processed )
20+ end
21+ end
22+ end
You can’t perform that action at this time.
0 commit comments