Browse Source

Fix ElasticSearch to Elasticsearch (#17050)

main
Takeshi Umeda 2 months ago
committed by GitHub
parent
commit
06631fdc53
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      .env.nanobox
  2. 2
      .env.production.sample
  3. 6
      config/initializers/chewy.rb
  4. 4
      lib/mastodon/search_cli.rb

2
.env.nanobox

@ -13,7 +13,7 @@ DB_PORT=5432
# DATABASE_URL=postgresql://$DATA_DB_USER:$DATA_DB_PASS@$DATA_DB_HOST/gonano
# Optional ElasticSearch configuration
# Optional Elasticsearch configuration
ES_ENABLED=true
ES_HOST=$DATA_ELASTIC_HOST
ES_PORT=9200

2
.env.production.sample

@ -29,7 +29,7 @@ DB_NAME=mastodon_production
DB_PASS=
DB_PORT=5432
# ElasticSearch (optional)
# Elasticsearch (optional)
# ------------------------
ES_ENABLED=true
ES_HOST=localhost

6
config/initializers/chewy.rb

@ -17,7 +17,7 @@ Chewy.settings = {
}
# We use our own async strategy even outside the request-response
# cycle, which takes care of checking if ElasticSearch is enabled
# cycle, which takes care of checking if Elasticsearch is enabled
# or not. However, mind that for the Rails console, the :urgent
# strategy is set automatically with no way to override it.
Chewy.root_strategy = :custom_sidekiq
@ -32,8 +32,8 @@ module Chewy
end
end
# ElasticSearch uses Faraday internally. Faraday interprets the
# Elasticsearch uses Faraday internally. Faraday interprets the
# http_proxy env variable by default which leads to issues when
# Mastodon is run with hidden services enabled, because
# ElasticSearch is *not* supposed to be accessed through a proxy
# Elasticsearch is *not* supposed to be accessed through a proxy
Faraday.ignore_env_proxy = true

4
lib/mastodon/search_cli.rb

@ -19,9 +19,9 @@ module Mastodon
option :concurrency, type: :numeric, default: 2, aliases: [:c], desc: 'Workload will be split between this number of threads'
option :batch_size, type: :numeric, default: 1_000, aliases: [:b], desc: 'Number of records in each batch'
option :only, type: :array, enum: %w(accounts tags statuses), desc: 'Only process these indices'
desc 'deploy', 'Create or upgrade ElasticSearch indices and populate them'
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
If Elasticsearch is empty, this command will create the necessary indices
and then import data from the database into those indices.
This command will also upgrade indices if the underlying schema has been

Loading…
Cancel
Save