Sha256: ec81aee3a2f5ecb33f4b3004c6f8a82bfe24ef225e192bbac90e8b3b7b1de25b

Contents?: true

Size: 594 Bytes

Versions: 29

Compression:

Stored size: 594 Bytes

Contents

module Searchkick
  class BulkReindexJob < ActiveJob::Base
    queue_as { Searchkick.queue_name }

    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_options) : 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

29 entries across 29 versions & 1 rubygems

Version Path
searchkick-4.6.3 lib/searchkick/bulk_reindex_job.rb
searchkick-4.6.2 lib/searchkick/bulk_reindex_job.rb
searchkick-4.6.1 lib/searchkick/bulk_reindex_job.rb
searchkick-4.6.0 lib/searchkick/bulk_reindex_job.rb
searchkick-4.5.2 lib/searchkick/bulk_reindex_job.rb
searchkick-4.5.1 lib/searchkick/bulk_reindex_job.rb
searchkick-4.5.0 lib/searchkick/bulk_reindex_job.rb
searchkick-4.4.4 lib/searchkick/bulk_reindex_job.rb
searchkick-4.4.3 lib/searchkick/bulk_reindex_job.rb
searchkick-4.4.2 lib/searchkick/bulk_reindex_job.rb
searchkick-4.4.1 lib/searchkick/bulk_reindex_job.rb
searchkick-4.4.0 lib/searchkick/bulk_reindex_job.rb
searchkick-4.3.1 lib/searchkick/bulk_reindex_job.rb
searchkick-4.3.0 lib/searchkick/bulk_reindex_job.rb
searchkick-4.2.1 lib/searchkick/bulk_reindex_job.rb
searchkick-4.2.0 lib/searchkick/bulk_reindex_job.rb
searchkick-4.1.1 lib/searchkick/bulk_reindex_job.rb
searchkick-4.1.0 lib/searchkick/bulk_reindex_job.rb
searchkick-4.0.2 lib/searchkick/bulk_reindex_job.rb
searchkick-4.0.1 lib/searchkick/bulk_reindex_job.rb