Commit 0f999c28af3185f81846ba95bcad0c01ad285aaa
1 parent
b3631cca
Exists in
master
and in
5 other branches
Improved error message for reload_synonyms with non-OSS version of Elasticsearch [skip ci]
Showing
2 changed files
with
9 additions
and
1 deletions
Show diff stats
CHANGELOG.md
lib/searchkick/index.rb
... | ... | @@ -180,7 +180,11 @@ module Searchkick |
180 | 180 | require "elasticsearch/xpack" |
181 | 181 | raise Error, "Requires Elasticsearch 7.3+" if Searchkick.server_below?("7.3.0") |
182 | 182 | raise Error, "Requires elasticsearch-xpack 7.8+" unless client.xpack.respond_to?(:indices) |
183 | - client.xpack.indices.reload_search_analyzers(index: name) | |
183 | + begin | |
184 | + client.xpack.indices.reload_search_analyzers(index: name) | |
185 | + rescue Elasticsearch::Transport::Transport::Errors::MethodNotAllowed | |
186 | + raise Error, "Requires non-OSS version of Elasticsearch" | |
187 | + end | |
184 | 188 | end |
185 | 189 | |
186 | 190 | # queue | ... | ... |