Module: ActiveFedora::Indexing
- Extended by:
- ActiveSupport::Autoload, ActiveSupport::Concern
- Included in:
- Base
- Defined in:
- lib/active_fedora/indexing.rb,
lib/active_fedora/indexing/map.rb
Defined Under Namespace
Modules: ClassMethods Classes: Map
Instance Method Summary collapse
- #indexing_service ⇒ Object
-
#to_solr(solr_doc = Hash.new, opts = {}) ⇒ Object
Return a Hash representation of this object where keys in the hash are appropriate Solr field names.
-
#update_index ⇒ Object
Updates Solr index with self.
Instance Method Details
#indexing_service ⇒ Object
18 19 20 |
# File 'lib/active_fedora/indexing.rb', line 18 def indexing_service @indexing_service ||= self.class.indexer.new(self) end |
#to_solr(solr_doc = Hash.new, opts = {}) ⇒ Object
Return a Hash representation of this object where keys in the hash are appropriate Solr field names. If opts == true, the base object metadata and the RELS-EXT datastream will be omitted. This is mainly to support shelver, which calls .to_solr for each model an object subscribes to.
14 15 16 |
# File 'lib/active_fedora/indexing.rb', line 14 def to_solr(solr_doc = Hash.new, opts={}) indexing_service.generate_solr_document end |
#update_index ⇒ Object
Updates Solr index with self.
23 24 25 |
# File 'lib/active_fedora/indexing.rb', line 23 def update_index SolrService.add(to_solr, softCommit: true) end |