aboutsummaryrefslogtreecommitdiff
blob: 71a032ae1563c6fe49568970d7e94aa4f8bd968c (plain)
1
2
3
4
5
6
7
8
9
10
require 'elasticsearch/persistence/model'

Elasticsearch::Persistence.client = Elasticsearch::Client.new host: ENV['ELASTICSEARCH_URL'] || 'elasticsearch:9300'

if Rails.env.development?
  logger           = ActiveSupport::Logger.new(STDERR)
  logger.level     = Logger::INFO
  logger.formatter = proc { |s, d, p, m| "\e[2m#{m}\n\e[0m" }
  Elasticsearch::Persistence.client.transport.logger = logger
end