clean up ES config
This commit is contained in:
parent
b0cdab2fbd
commit
fc836256ba
|
@ -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
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue