summaryrefslogtreecommitdiff
path: root/config/initializers/elasticsearch.rb
blob: 16fc9a5985321b563485a15724a30e74ddf38dc3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# frozen_string_literal: true
Elasticsearch::Model.client = Elasticsearch::Client.new(
  host: '127.0.0.1:9200',
  http: {
    user: Booru::CONFIG.secrets[:elasticsearch_username],
    password: Booru::CONFIG.secrets[:elasticsearch_password]
  },
  request_timeout: 30
)

# Prevents this message from appearing in logs:
#   You are setting a key that conflicts with a built-in method Hashie::Mash#key defined in Hash.
#   This can cause unexpected behavior when accessing the key via as a property.
#   You can still access the key via the #[] method.
Hashie.logger = Logger.new(nil)