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

Instance Method Details

#indexing_serviceObject



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.

Parameters:

  • solr_doc (Hash) (defaults to: Hash.new)

    (optional) Hash to insert the fields into

  • opts (Hash) (defaults to: {})

    (optional)



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_indexObject

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