Sha256: 2e419f08fdb27bb75a6c62b3bf73ea7c7fea06c9d1594f30bbeebbce2df2fa78

Contents?: true

Size: 512 Bytes

Versions: 1

Compression:

Stored size: 512 Bytes

Contents

module Searchkick
  class BulkReindexJob < ActiveJob::Base
    queue_as :searchkick

    def perform(class_name:, record_ids: nil, index_name: nil, method_name: nil, batch_id: nil, min_id: nil, max_id: nil)
      klass = class_name.constantize
      index = index_name ? Searchkick::Index.new(index_name) : klass.searchkick_index
      record_ids ||= min_id..max_id
      index.import_scope(Searchkick.load_records(klass, record_ids), method_name: method_name, batch: true, batch_id: batch_id)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
searchkick-2.0.4 lib/searchkick/bulk_reindex_job.rb