Class: Elastomer::CLI::Index

Inherits:
Base
  • Object
show all
Defined in:
lib/elastomer/cli/index.rb

Instance Method Summary collapse

Instance Method Details

#count(index, type) ⇒ Object



11
12
13
14
# File 'lib/elastomer/cli/index.rb', line 11

def count(index, type)
  response = client.docs(index, type).search({:query => {:match_all => {}}}, :search_type => :count)
  puts response["hits"]["total"]
end

#listObject



5
6
7
8
# File 'lib/elastomer/cli/index.rb', line 5

def list
  response = client.cluster.indices
  puts response.keys.sort
end