Commit 4d368a092000c36da251defedcb8ea4f3a7f4cab
1 parent
7f45ab50
Exists in
master
and in
17 other branches
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,7 +102,11 @@ module Searchkick | ||
102 | def all_indices(unaliased: false) | 102 | def all_indices(unaliased: false) |
103 | indices = | 103 | indices = |
104 | begin | 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 | rescue Elasticsearch::Transport::Transport::Errors::NotFound | 110 | rescue Elasticsearch::Transport::Transport::Errors::NotFound |
107 | {} | 111 | {} |
108 | end | 112 | end |
searchkick.gemspec
@@ -19,7 +19,7 @@ Gem::Specification.new do |spec| | @@ -19,7 +19,7 @@ Gem::Specification.new do |spec| | ||
19 | spec.required_ruby_version = ">= 2.2" | 19 | spec.required_ruby_version = ">= 2.2" |
20 | 20 | ||
21 | spec.add_dependency "activemodel", ">= 4.2" | 21 | spec.add_dependency "activemodel", ">= 4.2" |
22 | - spec.add_dependency "elasticsearch", ">= 5", "< 6.3" | 22 | + spec.add_dependency "elasticsearch", ">= 5" |
23 | spec.add_dependency "hashie" | 23 | spec.add_dependency "hashie" |
24 | 24 | ||
25 | spec.add_development_dependency "bundler" | 25 | spec.add_development_dependency "bundler" |