Example of usage
class GenericFile
after_solrize << :index_collection_pids
def index_collection_pids(solr_doc={})
collection_pids = self.collections.map {|c| c.pid}
solr_doc[Solrizer.solr_name(:collection, :searchable)] = collection_pids
end
end
Example of implementation
module ActiveFedora::Indexing
...
define_callbacks :solrize, :update_index
def to_solr(solr_doc={})
run_callbacks :save do
...
end
end
end
module Hydra::Collections::Collectible
def self.included(base)
base.after_solrize << :index_collection_pids
end
def index_collection_pids(solr_doc={})
collection_pids = self.collections.map {|c| c.pid}
solr_doc[Solrizer.solr_name(:collection, :searchable)] = collection_pids
end
end