Class: Cauchy::Elastic::Client
- Inherits:
-
Object
- Object
- Cauchy::Elastic::Client
- Defined in:
- lib/cauchy/elastic/client.rb
Instance Attribute Summary collapse
-
#server ⇒ Object
readonly
Returns the value of attribute server.
Instance Method Summary collapse
- #bulk(body) ⇒ Object
- #index(name) ⇒ Object
-
#initialize(config) ⇒ Client
constructor
A new instance of Client.
- #update_aliases(body) ⇒ Object
Constructor Details
#initialize(config) ⇒ Client
Returns a new instance of Client.
11 12 13 |
# File 'lib/cauchy/elastic/client.rb', line 11 def initialize(config) @server = Elasticsearch::Client.new(config) end |
Instance Attribute Details
#server ⇒ Object (readonly)
Returns the value of attribute server.
9 10 11 |
# File 'lib/cauchy/elastic/client.rb', line 9 def server @server end |
Instance Method Details
#bulk(body) ⇒ Object
19 20 21 |
# File 'lib/cauchy/elastic/client.rb', line 19 def bulk(body) server.bulk body: body end |
#index(name) ⇒ Object
15 16 17 |
# File 'lib/cauchy/elastic/client.rb', line 15 def index(name) Index.new(server, name) end |
#update_aliases(body) ⇒ Object
23 24 25 |
# File 'lib/cauchy/elastic/client.rb', line 23 def update_aliases(body) server.indices.update_aliases body: body end |