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
|
### Fixed
|
||||||
|
|
||||||
|
- Cleaned up ElasticSearch configuration in backend.
|
||||||
|
|
||||||
## [2.6.1 - 2019-08-10]
|
## [2.6.1 - 2019-08-10]
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|
|
@ -28,16 +28,7 @@ instances_config_path =
|
||||||
config :backend, Backend.Elasticsearch.Cluster,
|
config :backend, Backend.Elasticsearch.Cluster,
|
||||||
url: "http://localhost:9200",
|
url: "http://localhost:9200",
|
||||||
api: Elasticsearch.API.HTTP,
|
api: Elasticsearch.API.HTTP,
|
||||||
json_library: Jason,
|
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
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# Configures Elixir's Logger
|
# Configures Elixir's Logger
|
||||||
config :logger, :console,
|
config :logger, :console,
|
||||||
|
|
|
@ -1,3 +1,21 @@
|
||||||
defmodule Backend.Elasticsearch.Cluster do
|
defmodule Backend.Elasticsearch.Cluster do
|
||||||
use Elasticsearch.Cluster, otp_app: :backend
|
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
|
end
|
||||||
|
|
Loading…
Reference in a new issue