def index(name, &block)
      idx = Index.new(self, name, :logger => logger)
      block ? block.call(idx) : idx
    end
def index(name, &block)
      idx = Index.new(self, name, :logger => logger)
      block ? block.call(idx) : idx
    end
Represents a Server context in elastic search.
 Use +with_server+ when you want to use the block syntax.
 The options hash takes an optional instance of Logger under :logger.

    server = Stretcher::Server.new('http://localhost:9200')

 The default implementation here uses the net_http_persistent adapter
 for faraday. If you would like to use a different HTTP library, or alter
 other faraday config settings you may specify an optional :faraday_configurator
 argument, with a Proc as a value. This will be called once with the faraday builder.

 For instance:
 configurator = proc {|builder| builder.adapter :typhoeus
 Stretcher::Server.new('http://localhost:9200', :faraday_configurator => configurator)

 You may want to set one or both of :read_timeout and :open_timeout, for Faraday's HTTP
 settings. The default is read_timeout: 30, open_timeout: 2, which can be quite long
 in many situations

 When running inside a multi-threaded server such as EventMachine, and
 using a threadsafe HTTP library such as faraday, the mutex synchronization around
 API calls to the server can be avoided. In this case, set the option http_threadsafe: true

 Returns a Stretcher::Index object for the index +name+.
 Optionally takes a block, which will be passed a single arg with the Index obj
 The block syntax returns the evaluated value of the block

    my_server.index(:foo) # => #<Stretcher::Index ...>
    my_server.index(:foo) {|idx| 1+1} # => 2