Class: CDMDEXER::LoadWorker
- Inherits:
-
Object
- Object
- CDMDEXER::LoadWorker
- Includes:
- Sidekiq::Worker
- Defined in:
- lib/cdmdexer/load_worker.rb
Overview
Load Records into a solr index
Instance Attribute Summary collapse
-
#deletables ⇒ Object
readonly
Returns the value of attribute deletables.
- #loader_klass ⇒ Object
-
#records ⇒ Object
readonly
Returns the value of attribute records.
-
#solr_config ⇒ Object
readonly
Returns the value of attribute solr_config.
- #solr_klass ⇒ Object
Instance Method Summary collapse
Instance Attribute Details
#deletables ⇒ Object (readonly)
Returns the value of attribute deletables.
7 8 9 |
# File 'lib/cdmdexer/load_worker.rb', line 7 def deletables @deletables end |
#loader_klass ⇒ Object
16 17 18 |
# File 'lib/cdmdexer/load_worker.rb', line 16 def loader_klass @loader_klass ||= Loader end |
#records ⇒ Object (readonly)
Returns the value of attribute records.
7 8 9 |
# File 'lib/cdmdexer/load_worker.rb', line 7 def records @records end |
#solr_config ⇒ Object (readonly)
Returns the value of attribute solr_config.
7 8 9 |
# File 'lib/cdmdexer/load_worker.rb', line 7 def solr_config @solr_config end |
#solr_klass ⇒ Object
20 21 22 |
# File 'lib/cdmdexer/load_worker.rb', line 20 def solr_klass @solr_klass ||= DefaultSolr end |
Instance Method Details
#load! ⇒ Object
24 25 26 27 28 |
# File 'lib/cdmdexer/load_worker.rb', line 24 def load! loader_klass.new(records: records, deletable_ids: deletables, solr_client: solr_client).load! end |
#perform(records = [], deletables = [], solr_config = {}) ⇒ Object
9 10 11 12 13 14 |
# File 'lib/cdmdexer/load_worker.rb', line 9 def perform(records = [], deletables = [], solr_config = {}) @solr_config = solr_config.symbolize_keys @records = records @deletables = deletables load! end |