Class: BaseIndexer::MainIndexerEngine
- Inherits:
-
Object
- Object
- BaseIndexer::MainIndexerEngine
- Includes:
- DiscoveryIndexer
- Defined in:
- lib/base_indexer/main_indexer_engine.rb
Overview
It is responsible for performing the basic indexing steps, it includes reading the input from PURL server, getting collection names, mapping it to solr doc hash, and write it to SOLR core . It can also delete the object from all the registered
Instance Method Summary collapse
-
#delete(druid) ⇒ Object
It deletes an item defined by druid from all registered solr core.
-
#index(druid, targets = nil) ⇒ Object
It is the main indexing function.
Instance Method Details
#delete(druid) ⇒ Object
It deletes an item defined by druid from all registered solr core
39 40 41 42 |
# File 'lib/base_indexer/main_indexer_engine.rb', line 39 def delete(druid) solr_targets_configs = BaseIndexer.solr_configuration_class_name.constantize.instance.get_configuration_hash BaseIndexer.solr_writer_class_name.constantize.new.solr_delete_from_all(druid, solr_targets_configs) end |
#index(druid, targets = nil) ⇒ Object
It is the main indexing function
28 29 30 31 32 33 34 35 |
# File 'lib/base_indexer/main_indexer_engine.rb', line 28 def index(druid, targets = nil) # Map the input to solr_doc solr_doc = BaseIndexer.mapper_class_name.constantize.new(druid).convert_to_solr_doc # Get SOLR configuration and write solr_targets_configs = BaseIndexer.solr_configuration_class_name.constantize.instance.get_configuration_hash BaseIndexer.solr_writer_class_name.constantize.new.process(druid, solr_doc, targets, solr_targets_configs) end |