Commit 4d368a092000c36da251defedcb8ea4f3a7f4cab

Authored by Andrew Kane
1 parent 7f45ab50

Use get_alias when possible - fixes #1252

Showing 2 changed files with 6 additions and 2 deletions   Show diff stats
lib/searchkick/index.rb
... ... @@ -102,7 +102,11 @@ module Searchkick
102 102 def all_indices(unaliased: false)
103 103 indices =
104 104 begin
105   - client.indices.get_aliases
  105 + if client.indices.respond_to?(:get_alias)
  106 + client.indices.get_alias
  107 + else
  108 + client.indices.get_aliases
  109 + end
106 110 rescue Elasticsearch::Transport::Transport::Errors::NotFound
107 111 {}
108 112 end
... ...
searchkick.gemspec
... ... @@ -19,7 +19,7 @@ Gem::Specification.new do |spec|
19 19 spec.required_ruby_version = ">= 2.2"
20 20  
21 21 spec.add_dependency "activemodel", ">= 4.2"
22   - spec.add_dependency "elasticsearch", ">= 5", "< 6.3"
  22 + spec.add_dependency "elasticsearch", ">= 5"
23 23 spec.add_dependency "hashie"
24 24  
25 25 spec.add_development_dependency "bundler"
... ...