Class: ElasticSearch::Transport::Base

Inherits:
Object
  • Object
show all
Includes:
BaseProtocol
Defined in:
lib/elasticsearch/transport/base.rb

Direct Known Subclasses

HTTP, Thrift

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from BaseProtocol

#all_nodes

Methods included from ClusterAdminProtocol

#cluster_health, #cluster_state, #nodes_info, #nodes_stats, #restart_nodes, #shutdown_nodes

Methods included from IndexAdminProtocol

#alias_index, #create_index, #delete_index, #flush, #index_status, #optimize, #refresh, #snapshot, #update_mapping

Methods included from IndexProtocol

#count, #delete, #get, #index, #scroll, #search

Constructor Details

#initialize(server, options = {}) ⇒ Base

Returns a new instance of Base.



16
17
18
19
# File 'lib/elasticsearch/transport/base.rb', line 16

def initialize(server, options={})
  @server = server
  @options = DEFAULTS.merge(options)
end

Instance Attribute Details

#optionsObject

Returns the value of attribute options.



14
15
16
# File 'lib/elasticsearch/transport/base.rb', line 14

def options
  @options
end

#serverObject

Returns the value of attribute server.



14
15
16
# File 'lib/elasticsearch/transport/base.rb', line 14

def server
  @server
end

Instance Method Details

#closeObject



25
26
# File 'lib/elasticsearch/transport/base.rb', line 25

def close
end

#connect!Object

Raises:

  • (NotImplementedError)


21
22
23
# File 'lib/elasticsearch/transport/base.rb', line 21

def connect!
  raise NotImplementedError
end

#encoderObject



28
29
30
# File 'lib/elasticsearch/transport/base.rb', line 28

def encoder
  @encoder ||= @options[:encoder].new
end

#request(method, operation, params = {}, body = nil, headers = {}) ⇒ Object

Raises:

  • (NotImplementedError)


32
33
34
# File 'lib/elasticsearch/transport/base.rb', line 32

def request(method, operation, params={}, body=nil, headers={})
  raise NotImplementedError
end