Module: ElasticSearch::AutoDiscoveringClient

Included in:
Client
Defined in:
lib/elasticsearch/client/auto_discovering_client.rb

Constant Summary collapse

AUTO_DISCOVERING_DEFAULTS =
{
  :auto_discovery => true
}.freeze

Instance Method Summary collapse

Instance Method Details

#auto_discover_nodes!Object

TODO how to autodiscover on reconnect? don’t want to overwrite methods of RetryingClient



17
18
19
# File 'lib/elasticsearch/client/auto_discovering_client.rb', line 17

def auto_discover_nodes!
  @servers = execute(:all_nodes)
end

#initialize(servers_or_url, options = {}) ⇒ Object



8
9
10
11
12
13
14
# File 'lib/elasticsearch/client/auto_discovering_client.rb', line 8

def initialize(servers_or_url, options={})
  super
  @options = AUTO_DISCOVERING_DEFAULTS.merge(@options)
  if @options[:auto_discovery]
    auto_discover_nodes!
  end
end