module Searchkick::IndexWithInstrumentation

Public Instance Methods

import(records) click to toggle source
Calls superclass method
# File lib/searchkick/logging.rb, line 48
def import(records)
  if records.any?
    event = {
      name: "#{records.first.searchkick_klass.name} Import",
      count: records.size
    }
    ActiveSupport::Notifications.instrument("request.searchkick", event) do
      super(records)
    end
  end
end
remove(record) click to toggle source
Calls superclass method
# File lib/searchkick/logging.rb, line 33
def remove(record)
  name = record && record.searchkick_klass ? "#{record.searchkick_klass.name} Remove" : "Remove"
  event = {
    name: name,
    id: search_id(record)
  }
  if Searchkick.callbacks_value == :bulk
    super
  else
    ActiveSupport::Notifications.instrument("request.searchkick", event) do
      super
    end
  end
end
store(record) click to toggle source
Calls superclass method
# File lib/searchkick/logging.rb, line 19
def store(record)
  event = {
    name: "#{record.searchkick_klass.name} Store",
    id: search_id(record)
  }
  if Searchkick.callbacks_value == :bulk
    super
  else
    ActiveSupport::Notifications.instrument("request.searchkick", event) do
      super
    end
  end
end