Class: DorIndexing::Indexers::IdentifiableIndexer
- Inherits:
-
Object
- Object
- DorIndexing::Indexers::IdentifiableIndexer
- Defined in:
- lib/dor_indexing/indexers/identifiable_indexer.rb
Overview
Indexes the druid, metadata sources, and the apo titles
Constant Summary collapse
- CURRENT_CATALOG_TYPE =
'folio'
- @@apo_hash =
Module-level variable, shared between ALL mixin includers (and ALL their includers/extenders)! used for caching apo titles
{}
Instance Attribute Summary collapse
-
#administrative_tags_finder ⇒ Object
readonly
Returns the value of attribute administrative_tags_finder.
-
#cocina ⇒ Object
readonly
Returns the value of attribute cocina.
-
#cocina_finder ⇒ Object
readonly
Returns the value of attribute cocina_finder.
Class Method Summary collapse
-
.reset_cache! ⇒ Object
Clears out the cache of apos.
Instance Method Summary collapse
-
#initialize(cocina:, cocina_finder:, administrative_tags_finder:) ⇒ IdentifiableIndexer
constructor
A new instance of IdentifiableIndexer.
-
#to_solr ⇒ Hash
The partial solr document for identifiable concerns.
Constructor Details
#initialize(cocina:, cocina_finder:, administrative_tags_finder:) ⇒ IdentifiableIndexer
Returns a new instance of IdentifiableIndexer.
11 12 13 14 15 |
# File 'lib/dor_indexing/indexers/identifiable_indexer.rb', line 11 def initialize(cocina:, cocina_finder:, administrative_tags_finder:, **) @cocina = cocina @cocina_finder = cocina_finder @administrative_tags_finder = end |
Instance Attribute Details
#administrative_tags_finder ⇒ Object (readonly)
Returns the value of attribute administrative_tags_finder.
7 8 9 |
# File 'lib/dor_indexing/indexers/identifiable_indexer.rb', line 7 def @administrative_tags_finder end |
#cocina ⇒ Object (readonly)
Returns the value of attribute cocina.
7 8 9 |
# File 'lib/dor_indexing/indexers/identifiable_indexer.rb', line 7 def cocina @cocina end |
#cocina_finder ⇒ Object (readonly)
Returns the value of attribute cocina_finder.
7 8 9 |
# File 'lib/dor_indexing/indexers/identifiable_indexer.rb', line 7 def cocina_finder @cocina_finder end |
Class Method Details
.reset_cache! ⇒ Object
Clears out the cache of apos. Used primarily in testing.
33 34 35 |
# File 'lib/dor_indexing/indexers/identifiable_indexer.rb', line 33 def self.reset_cache! @@apo_hash = {} # rubocop:disable Style/ClassVars end |
Instance Method Details
#to_solr ⇒ Hash
Returns the partial solr document for identifiable concerns.
22 23 24 25 26 27 28 29 30 |
# File 'lib/dor_indexing/indexers/identifiable_indexer.rb', line 22 def to_solr {}.tap do |solr_doc| add_apo_titles(solr_doc, cocina.administrative.hasAdminPolicy) solr_doc['metadata_source_ssim'] = unless cocina.is_a? Cocina::Models::AdminPolicyWithMetadata solr_doc['druid_prefixed_ssi'] = cocina.externalIdentifier solr_doc['druid_bare_ssi'] = cocina.externalIdentifier.delete_prefix('druid:') end end |