Class: Samvera::NestingIndexer::RepositoryReindexer Private
- Inherits:
-
Object
- Object
- Samvera::NestingIndexer::RepositoryReindexer
- Extended by:
- Forwardable
- Defined in:
- lib/samvera/nesting_indexer/repository_reindexer.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
There is cycle detection logic for walking the graph prior to attempting relationship re-indexing
Responsible for reindexing the entire repository
Class Method Summary collapse
-
.call(*args) ⇒ Object
private
A convenience method to reindex all documents.
Instance Method Summary collapse
- #call ⇒ Object private
-
#initialize(maximum_nesting_depth:, id_reindexer:, configuration:, extent:) ⇒ RepositoryReindexer
constructor
private
A new instance of RepositoryReindexer.
Constructor Details
#initialize(maximum_nesting_depth:, id_reindexer:, configuration:, extent:) ⇒ RepositoryReindexer
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of RepositoryReindexer.
25 26 27 28 29 30 31 |
# File 'lib/samvera/nesting_indexer/repository_reindexer.rb', line 25 def initialize(maximum_nesting_depth:, id_reindexer:, configuration:, extent:) @maximum_nesting_depth = maximum_nesting_depth.to_i @id_reindexer = id_reindexer @configuration = configuration @extent = extent @processed_ids = [] end |
Class Method Details
.call(*args) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
This could crush your system as it will loop through ALL the documents
A convenience method to reindex all documents.
17 18 19 |
# File 'lib/samvera/nesting_indexer/repository_reindexer.rb', line 17 def self.call(*args) new(*args).call end |
Instance Method Details
#call ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Would it make sense to leverage an each_preservation_id instead?
34 35 36 37 38 |
# File 'lib/samvera/nesting_indexer/repository_reindexer.rb', line 34 def call adapter.each_perservation_document_id_and_parent_ids do |id, parent_ids| recursive_reindex(id: id, parent_ids: parent_ids, time_to_live: maximum_nesting_depth) end end |