Sha256: 36cc55454c913d7736d43e08fec655ebb97ef13ed78f828c2c9347c588e988f6

Contents?: true

Size: 514 Bytes

Versions: 1

Compression:

Stored size: 514 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(klass.where(klass.primary_key => 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.3 lib/searchkick/bulk_reindex_job.rb