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 CHANGED
@@ -1,3 +1,6 @@
1
+ VERSION 1.1.3
2
+ - improve memory usage (via amuino)
3
+ VERSION 1.1.1
1
4
  - highlighting support (needs doc)
2
5
  - invalid chars in XML bug fix
3
6
  - Raise a specific Exception class on connection error
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.1.2
1
+ 1.1.3
data/acts_as_solr.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{acts_as_solr}
8
- s.version = "1.1.2"
8
+ s.version = "1.1.3"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Kyle Maxwell"]
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
- add_batch = items.collect { |content| content.to_solr_doc }
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 add_batch
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
- offset += items.size
229
+
229
230
  end while items.nil? || items.size > 0
230
231
  else
231
232
  items = finder.call(self, {})
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: acts_as_solr
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.2
4
+ version: 1.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kyle Maxwell