We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4f7133b commit bd6a122Copy full SHA for bd6a122
1 file changed
lib/geo_combine/indexer.rb
@@ -35,16 +35,10 @@ def index(docs)
35
start_time = Process.clock_gettime(Process::CLOCK_MONOTONIC)
36
37
# Index in batches; set batch size via BATCH_SIZE
38
- batch = []
39
- docs.each do |doc, path|
40
- if batch.size < @batch_size
41
- batch << [doc, path]
42
- else
43
- total_indexed += index_batch(batch)
44
- batch = [[doc, path]]
45
- end
+ docs.each_slice(@batch_size) do |slice|
+ batch = slice.map { |doc, path| [doc, path] }
+ total_indexed += index_batch(batch)
46
end
47
- total_indexed += index_batch(batch) unless batch.empty?
48
49
# Issue a commit to make sure all documents are indexed
50
@solr.commit
0 commit comments