lib/searchkick/logging.rb in searchkick-0.7.1 vs lib/searchkick/logging.rb in searchkick-0.7.2
- old
+ new
@@ -35,13 +35,14 @@
return unless logger.debug?
payload = event.payload
name = "#{payload[:name]} (#{event.duration.round(1)}ms)"
type = payload[:query][:type]
+ index = payload[:query][:index].is_a?(Array) ? payload[:query][:index].join(",") : payload[:query][:index]
# no easy way to tell which host the client will use
host = Searchkick.client.transport.hosts.first
- debug " #{color(name, YELLOW, true)} curl #{host[:protocol]}://#{host[:host]}:#{host[:port]}/#{CGI.escape(payload[:query][:index])}#{type ? "/#{type.map{|t| CGI.escape(t) }.join(",")}" : ""}/_search?pretty -d '#{payload[:query][:body].to_json}'"
+ debug " #{color(name, YELLOW, true)} curl #{host[:protocol]}://#{host[:host]}:#{host[:port]}/#{CGI.escape(index)}#{type ? "/#{type.map{|t| CGI.escape(t) }.join(",")}" : ""}/_search?pretty -d '#{payload[:query][:body].to_json}'"
end
end
# https://github.com/rails/rails/blob/master/activerecord/lib/active_record/railties/controller_runtime.rb
module ControllerRuntime