Class: Esearch::Connection
- Inherits:
-
Object
- Object
- Esearch::Connection
- Includes:
- Adamantium::Flat
- Defined in:
- lib/esearch/connection.rb
Overview
Connection to an elasticsearch cluster
Class Method Summary collapse
-
.build(uri, logger = NullLogger.instance) ⇒ Connection
private
Return connection.
Instance Method Summary collapse
-
#run(request) ⇒ Faraday::Request
private
Run request.
Class Method Details
.build(uri, logger = NullLogger.instance) ⇒ Connection
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Return connection
16 17 18 |
# File 'lib/esearch/connection.rb', line 16 def self.build(uri, logger = NullLogger.instance) new(Faraday.new(uri), logger) end |
Instance Method Details
#run(request) ⇒ Faraday::Request
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Run request
28 29 30 31 32 33 34 |
# File 'lib/esearch/connection.rb', line 28 def run(request) util = logger util.debug { request.log_string } response = request.run(raw_connection) util.debug { response.status.to_s } response end |