app/models/spotlight/resource.rb in blacklight-spotlight-0.14.2 vs app/models/spotlight/resource.rb in blacklight-spotlight-0.15.0
- old
+ new
@@ -166,15 +166,17 @@
def batch_size
Spotlight::Engine.config.solr_batch_size
end
def write_to_index(batch)
+ return unless write?
blacklight_solr.update params: { commitWithin: 500 },
data: batch.to_json,
headers: { 'Content-Type' => 'application/json' }
end
def commit
+ return unless write?
blacklight_solr.commit
rescue => e
Rails.logger.warn "Unable to commit to solr: #{e}"
end
end