Commit 70c37b1393be58170f01e08b9048c2198b1386e8
1 parent
2cdcbb24
Exists in
master
and in
5 other branches
Fixed error with debug option with elasticsearch-ruby 7.14
Showing
2 changed files
with
7 additions
and
1 deletions
Show diff stats
CHANGELOG.md
lib/searchkick/query.rb
... | ... | @@ -109,7 +109,12 @@ module Searchkick |
109 | 109 | request_params = query.except(:index, :type, :body) |
110 | 110 | |
111 | 111 | # no easy way to tell which host the client will use |
112 | - host = Searchkick.client.transport.hosts.first | |
112 | + host = | |
113 | + if Elasticsearch::VERSION.to_f >= 7.14 | |
114 | + Searchkick.client.transport.transport.hosts.first | |
115 | + else | |
116 | + Searchkick.client.transport.hosts.first | |
117 | + end | |
113 | 118 | credentials = host[:user] || host[:password] ? "#{host[:user]}:#{host[:password]}@" : nil |
114 | 119 | params = ["pretty"] |
115 | 120 | request_params.each do |k, v| | ... | ... |