Module: Searchkick::SearchkickWithInstrumentation

Defined in:
lib/searchkick/logging.rb

Instance Method Summary collapse

Instance Method Details

#multi_search(searches) ⇒ Object


62
63
64
65
66
67
68
69
70
# File 'lib/searchkick/logging.rb', line 62

def multi_search(searches)
  event = {
    name: "Multi Search",
    body: searches.flat_map { |q| [q.params.except(:body).to_json, q.body.to_json] }.map { |v| "#{v}\n" }.join
  }
  ActiveSupport::Notifications.instrument("multi_search.searchkick", event) do
    super
  end
end

#perform_items(items) ⇒ Object


72
73
74
75
76
77
78
79
80
81
82
83
84
# File 'lib/searchkick/logging.rb', line 72

def perform_items(items)
  if callbacks_value == :bulk
    event = {
      name: "Bulk",
      count: items.size
    }
    ActiveSupport::Notifications.instrument("request.searchkick", event) do
      super
    end
  else
    super
  end
end