Commit 013ef3cc16c71b86c1f4164f009d3a373a2ebf75

Authored by Daniel Westendorf
1 parent 6c375797

Correctly pass the id of the batch

Showing 1 changed file with 3 additions and 2 deletions   Show diff stats
lib/searchkick/index.rb
... ... @@ -433,8 +433,9 @@ module Searchkick
433 433 bulk_reindex_job scope, batch_id, min_id: min_id, max_id: min_id + batch_size - 1
434 434 end
435 435 else
436   - batch_id = 1
437   - scope.in_batches(of: batch_size).each do |batch|
  436 + scope.in_batches(of: batch_size).each_with_index do |batch, i|
  437 + batch_id = i + 1
  438 +
438 439 bulk_reindex_job scope, batch_id, record_ids: batch.pluck(primary_key)
439 440 end
440 441 end
... ...