Module: Chewy::Index::Aliases::ClassMethods

Defined in:
lib/chewy/index/aliases.rb

Instance Method Summary collapse

Instance Method Details

#aliasesObject



13
14
15
16
17
18
# File 'lib/chewy/index/aliases.rb', line 13

def aliases
  name = index_name
  client.indices.get_alias(index: name, name: '*')[name].try(:[], 'aliases').try(:keys) || []
rescue Elasticsearch::Transport::Transport::Errors::NotFound
  []
end

#indexesObject



7
8
9
10
11
# File 'lib/chewy/index/aliases.rb', line 7

def indexes
  client.indices.get_alias(name: index_name).keys
rescue Elasticsearch::Transport::Transport::Errors::NotFound
  []
end