Configure Elasticsearch

Workarea uses an instance of Elasticsearch::Client from the official Elasticsearch Ruby integration to talk to Elasticsearch.

Workarea automatically configures Elasticsearch, loading the first present config in the following order:

  1. A hash found at Workarea.config.elasticsearch
  2. A hash found at Rails.application.secrets.elasticsearch
  3. The environment variables for multiple hosts. e.g. WORKAREA_ELASTICSEARCH_URL_0, WORKAREA_ELASTICSEARCH_URL_1, etc
  4. The URL found in the environment variable WORKAREA_ELASTICSEARCH_URL
  5. The default value of localhost:9200