Class: Cauchy::Elastic::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/cauchy/elastic/client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#serverObject (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