diff --git a/config/initializers/elasticsearch.rb b/config/initializers/elasticsearch.rb index 5f8f7d446..1e6b9966e 100644 --- a/config/initializers/elasticsearch.rb +++ b/config/initializers/elasticsearch.rb @@ -1,3 +1,8 @@ -client = Elasticsearch::Client.new host: "http://#{Rails.application.secrets.elaticsearch_host}:9200", log: true +if Rails.env.test? + client = Elasticsearch::Client.new host: "http://#{Rails.application.secrets.elaticsearch_host}:9200", log: false +else + client = Elasticsearch::Client.new host: "http://#{Rails.application.secrets.elaticsearch_host}:9200", log: true +end + Elasticsearch::Model.client = client Elasticsearch::Persistence.client = client