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

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

Instance Method Summary collapse

Instance Method Details

#aliasesObject



15
16
17
18
19
20
21
# File 'lib/chewy/index/aliases.rb', line 15

def aliases
  empty_if_not_found do
    client.indices.get_alias(index: index_name, name: '*').values.flat_map do |aliases|
      aliases['aliases'].keys
    end
  end.compact.uniq
end

#indexesObject



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

def indexes
  get_args = {index: index_name}
  get_args[:include_type_name] = true if Runtime.version >= '6.7.0'
  indexes = empty_if_not_found { client.indices.get(**get_args).keys }
  indexes += empty_if_not_found { client.indices.get_alias(name: index_name).keys }
  indexes.compact.uniq
end