lib/searchkick/logging.rb in searchkick-4.0.0 vs lib/searchkick/logging.rb in searchkick-4.0.1
- old
+ new
@@ -165,10 +165,12 @@
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(index)}#{type ? "/#{type.map { |t| CGI.escape(t) }.join(',')}" : ''}/_search?pretty -H 'Content-Type: application/json' -d '#{payload[:query][:body].to_json}'"
+ params = ["pretty"]
+ params << "scroll=#{payload[:query][:scroll]}" if payload[:query][:scroll]
+ debug " #{color(name, YELLOW, true)} curl #{host[:protocol]}://#{host[:host]}:#{host[:port]}/#{CGI.escape(index)}#{type ? "/#{type.map { |t| CGI.escape(t) }.join(',')}" : ''}/_search?#{params.join('&')} -H 'Content-Type: application/json' -d '#{payload[:query][:body].to_json}'"
end
def request(event)
self.class.runtime += event.duration
return unless logger.debug?