Class: Spotlight::SolrDocumentSidecar
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Spotlight::SolrDocumentSidecar
- Extended by:
- ActsAsTaggableOn::Taggable
- Defined in:
- app/models/spotlight/solr_document_sidecar.rb
Overview
Exhibit-specific metadata for indexed documents
Instance Method Summary collapse
- #default_document_type ⇒ Object
-
#document ⇒ Object
Roll our own polymorphism because our documents are not AREL-able.
- #private! ⇒ Object
- #public! ⇒ Object
- #to_solr ⇒ Object
Instance Method Details
#default_document_type ⇒ Object
39 40 41 |
# File 'app/models/spotlight/solr_document_sidecar.rb', line 39 def default_document_type blacklight_config.document_model end |
#document ⇒ Object
Roll our own polymorphism because our documents are not AREL-able
35 36 37 |
# File 'app/models/spotlight/solr_document_sidecar.rb', line 35 def document document_type_class.new document_type_class.unique_key => document_id end |
#private! ⇒ Object
26 27 28 |
# File 'app/models/spotlight/solr_document_sidecar.rb', line 26 def private! update public: false end |
#public! ⇒ Object
30 31 32 |
# File 'app/models/spotlight/solr_document_sidecar.rb', line 30 def public! update public: true end |
#to_solr ⇒ Object
19 20 21 22 23 24 |
# File 'app/models/spotlight/solr_document_sidecar.rb', line 19 def to_solr { document.class.unique_key.to_sym => document.id, visibility_field => public? } .merge(data_to_solr) .merge(exhibit.solr_data) end |