clean up ES config

This commit is contained in:
Tao Bror Bojlén 2019-08-15 16:19:26 +02:00
parent b0cdab2fbd
commit fc836256ba
No known key found for this signature in database
GPG key ID: C6EC7AAB905F9E6F
3 changed files with 21 additions and 10 deletions

View file

@ -17,6 +17,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed
- Cleaned up ElasticSearch configuration in backend.
## [2.6.1 - 2019-08-10]
### Fixed

View file

@ -28,16 +28,7 @@ instances_config_path =
config :backend, Backend.Elasticsearch.Cluster,
url: "http://localhost:9200",
api: Elasticsearch.API.HTTP,
json_library: Jason,
indexes: %{
instances: %{
settings: instances_config_path,
store: Backend.Elasticsearch.Store,
sources: [Backend.Instance],
bulk_page_size: 1000,
bulk_wait_interval: 1_000
}
}
json_library: Jason
# Configures Elixir's Logger
config :logger, :console,

View file

@ -1,3 +1,21 @@
defmodule Backend.Elasticsearch.Cluster do
use Elasticsearch.Cluster, otp_app: :backend
def init(config) do
indexes = %{
instances: %{
settings: Application.app_dir(:backend, "priv/elasticsearch/instances.json"),
store: Backend.Elasticsearch.Store,
sources: [Backend.Instance],
bulk_page_size: 1000,
bulk_wait_interval: 1000
}
}
config =
config
|> Map.put(:indexes, indexes)
{:ok, config}
end
end