aboutsummaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
Diffstat (limited to 'config')
-rw-r--r--config/initializers/elasticsearch.rb7
1 files changed, 4 insertions, 3 deletions
diff --git a/config/initializers/elasticsearch.rb b/config/initializers/elasticsearch.rb
index 4ced5b5..1037b1f 100644
--- a/config/initializers/elasticsearch.rb
+++ b/config/initializers/elasticsearch.rb
@@ -1,9 +1,10 @@
-require 'elasticsearch/persistence/model'
+require 'elasticsearch/persistence'
+
+DEFAULT_CLIENT = Elasticsearch::Client.new host: ENV['ELASTICSEARCH_URL'] || 'localhost:9200'
-Elasticsearch::Persistence.client = Elasticsearch::Client.new host: ENV['ELASTICSEARCH_URL'] || 'localhost:9200'
if Rails.env.development? or ENV['RAILS_DEBUG']
logger = ActiveSupport::Logger.new(STDERR)
logger.level = Logger::DEBUG
logger.formatter = proc { |s, d, p, m| "\e[2m#{m}\n\e[0m" }
- Elasticsearch::Persistence.client.transport.logger = logger
+ DEFAULT_CLIENT.transport.logger = logger
end