diff --git a/CHANGELOG.md b/CHANGELOG.md index 66dd33e..ce7b1e6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ - Fixed error with reindex queue - Fixed error with `model_name` method with multiple models +- Fixed error with `debug` option with elasticsearch-ruby 7.14 ## 4.5.1 (2021-08-03) diff --git a/lib/searchkick/query.rb b/lib/searchkick/query.rb index f943376..95e6a6f 100644 --- a/lib/searchkick/query.rb +++ b/lib/searchkick/query.rb @@ -109,7 +109,12 @@ module Searchkick request_params = query.except(:index, :type, :body) # no easy way to tell which host the client will use - host = Searchkick.client.transport.hosts.first + host = + if Elasticsearch::VERSION.to_f >= 7.14 + Searchkick.client.transport.transport.hosts.first + else + Searchkick.client.transport.hosts.first + end credentials = host[:user] || host[:password] ? "#{host[:user]}:#{host[:password]}@" : nil params = ["pretty"] request_params.each do |k, v| -- libgit2 0.21.0