acts_as_solr 1.1.2 → 1.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/FORKED_CHANGES +3 -0
- data/VERSION +1 -1
- data/acts_as_solr.gemspec +1 -1
- data/lib/class_methods.rb +8 -7
- metadata +1 -1
data/FORKED_CHANGES
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.1.
|
1
|
+
1.1.3
|
data/acts_as_solr.gemspec
CHANGED
data/lib/class_methods.rb
CHANGED
@@ -212,20 +212,21 @@ module ActsAsSolr #:nodoc:
|
|
212
212
|
offset = 0
|
213
213
|
begin
|
214
214
|
iteration_start = Time.now
|
215
|
-
items = finder.call(self, {:limit => limit, :offset => offset})
|
216
|
-
|
217
|
-
|
215
|
+
items = finder.call(self, {:limit => limit, :offset => offset, :readonly => true})
|
216
|
+
items_processed += items.size
|
217
|
+
last_id = items.last.id if items.last
|
218
|
+
offset += items.size
|
219
|
+
|
220
|
+
items.collect! { |content| content.to_solr_doc }
|
218
221
|
if items.size > 0
|
219
|
-
solr_add
|
222
|
+
solr_add items
|
220
223
|
solr_commit
|
221
224
|
end
|
222
225
|
|
223
|
-
items_processed += items.size
|
224
|
-
last_id = items.last.id if items.last
|
225
226
|
time_so_far = Time.now - start_time
|
226
227
|
iteration_time = Time.now - iteration_start
|
227
228
|
logger.info "#{Process.pid}: #{items_processed} items for #{self.name} have been batch added to index in #{'%.3f' % time_so_far}s at #{'%.3f' % (items_processed / time_so_far)} items/sec (#{'%.3f' % (items.size / iteration_time)} items/sec for the last batch). Last id: #{last_id}"
|
228
|
-
|
229
|
+
|
229
230
|
end while items.nil? || items.size > 0
|
230
231
|
else
|
231
232
|
items = finder.call(self, {})
|