lib/tasks/spotlight_tasks.rake in blacklight-spotlight-0.3.1 vs lib/tasks/spotlight_tasks.rake in blacklight-spotlight-0.4.1
- old
+ new
@@ -74,18 +74,18 @@
desc "Check the Solr connection and controller configuration"
task :solr, [:model_name] => ['blacklight:check:solr', :environment] do |_, args|
errors = 0
verbose = ENV.fetch('VERBOSE', false).present?
- puts "[#{Blacklight.solr.uri}]"
+ puts "[#{Blacklight.default_index.connection.uri}]"
print " - atomic updates:"
begin
id = 'test123'
field = "test_#{Spotlight::Engine.config.solr_fields.string_suffix}"
- Blacklight.solr.add blacklight_config.solr_document_model.unique_key.to_sym => id, field => 'some-string'
- Blacklight.solr.update data: [{blacklight_config.solr_document_model.unique_key => id, field => { set: 'a-new-string' }}].to_json, headers: { 'Content-Type' => 'application/json' }
- Blacklight.solr.delete_by_id id
+ Blacklight.default_index.connection.add Spotlight::Engine.blacklight_config.document_model.unique_key.to_sym => id, field => 'some-string'
+ Blacklight.default_index.connection.update data: [{Spotlight::Engine.blacklight_config.document_model.unique_key => id, field => { set: 'a-new-string' }}].to_json, headers: { 'Content-Type' => 'application/json' }
+ Blacklight.default_index.connection.delete_by_id id
print " OK\n"
rescue Exception => e
errors += 1
puts e.to_s
end