if Rails.env.production? config.cache_store = :redis_store, 'redis://localhost:6379/0/cache', { expires_in: 90.minutes } config.after_initialize do Elasticsearch::Client.new hosts: ['192.168.80.168:9200'], retry_on_failure: true end elsif Rails.env.development? config.after_initialize do Elasticsearch::Client.new hosts: ['localhost:9200'], retry_on_failure: true end end