ESClient v1.0.0 ESClient.Config View Source

A helper module to retrieve configuration values and defaults for the client.

Link to this section Summary

Functions

Builds a new config.

Link to this section Types

Link to this type

t()

View Source
t() :: %ESClient.Config{
  base_url: String.t() | URI.t(),
  driver: module(),
  json_keys: :atoms | :atoms! | :strings,
  json_library: module(),
  timeout: timeout()
}

Link to this section Functions

Link to this function

new(config_or_opts)

View Source
new(t() | Keyword.t() | %{optional(atom()) => any()}) :: t()

Builds a new config.

Options

  • :base_url - The URL of the Elasticsearch endpoint. Defaults to http://localhost:9200.
  • :driver - The driver to use to transfer data from and to Elasticsearch. Defaults to ESClient.Drivers.HTTPoison.
  • :json_keys - Determines how to convert keys in decoded JSON objects. Possible values are :atoms, :atoms! and strings (default). Note that the JSON library has to support these options.
  • :json_library - The JSON library that encodes request data and decodes response data. Defaults to Jason.
  • :timeout - The time to wait before aborting a request. Can be a non-negative integer or :infinity. Defaults to 15000 (milliseconds).