module ActiveFedora::Indexing
def create_needs_index?
Determines whether a create operation causes a solr index of this object by default.
def create_needs_index? ENABLE_SOLR_UPDATES end
def create_record(options = {})
def create_record(options = {}) super update_index if create_needs_index? && options.fetch(:update_index, true) true end
def indexing_service
def indexing_service @indexing_service ||= self.class.indexer.new(self) end
def to_solr(solr_doc = Hash.new, opts={})
-
opts
(Hash
) -- (optional) -
solr_doc
(Hash
) -- (optional) Hash to insert the fields into
def to_solr(solr_doc = Hash.new, opts={}) indexing_service.generate_solr_document end
def update_index
def update_index SolrService.add(to_solr, softCommit: true) end
def update_needs_index?
Determines whether an update operation causes a solr index of this object by default.
def update_needs_index? ENABLE_SOLR_UPDATES end
def update_record(options = {})
def update_record(options = {}) super update_index if update_needs_index? && options.fetch(:update_index, true) true end