Commit 70c37b1393be58170f01e08b9048c2198b1386e8

Authored by Andrew Kane
1 parent 2cdcbb24

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
... ... @@ -2,6 +2,7 @@
2 2  
3 3 - Fixed error with reindex queue
4 4 - Fixed error with `model_name` method with multiple models
  5 +- Fixed error with `debug` option with elasticsearch-ruby 7.14
5 6  
6 7 ## 4.5.1 (2021-08-03)
7 8  
... ...
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|
... ...