lib/sunspot/rails/searchable.rb in adamsalter-sunspot_rails-0.10.4 vs lib/sunspot/rails/searchable.rb in adamsalter-sunspot_rails-0.10.5
- old
+ new
@@ -206,10 +206,11 @@
#
# ==== Returns
#
# Array:: Collection of IDs that exist in Solr but not in the database
def index_orphans
- indexed_ids = search_ids.to_set
+ count = self.count
+ indexed_ids = search_ids { paginate(:page => 1, :per_page => count) }.to_set
all(:select => 'id').each do |object|
indexed_ids.delete(object.id)
end
indexed_ids.to_a
end