app/models/spotlight/resource.rb in blacklight-spotlight-0.3.1 vs app/models/spotlight/resource.rb in blacklight-spotlight-0.4.1

- old
+ new

@@ -28,16 +28,19 @@ p.sort_by(&:weight).first end def to_solr exhibit.solr_data.merge({ - :"#{Spotlight::Engine.config.solr_fields.prefix}spotlight_resource_id#{Spotlight::Engine.config.solr_fields.string_suffix}" => "#{(type.tableize if type) || self.class.to_s.tableize }:#{id}", - :"#{Spotlight::Engine.config.solr_fields.prefix}spotlight_resource_url#{Spotlight::Engine.config.solr_fields.string_suffix}" => url, + Spotlight::Resource.resource_global_id_field => self.to_global_id.to_s, Spotlight::SolrDocument.resource_type_field => self.class.to_s.tableize }) end + def self.resource_global_id_field + :"#{Spotlight::Engine.config.solr_fields.prefix}spotlight_resource_id#{Spotlight::Engine.config.solr_fields.string_suffix}" + end + def reindex_with_lock with_lock do yield end end @@ -75,17 +78,17 @@ end protected def blacklight_solr - @solr ||= RSolr.connect(blacklight_solr_config) + @solr ||= RSolr.connect(connection_config) end - def blacklight_solr_config - Blacklight.solr_config + def connection_config + Blacklight.connection_config end - def solr_document_model - exhibit.blacklight_config.solr_document_model + def document_model + exhibit.blacklight_config.document_model end end end